I am trying to insert a variable (@RefNum) into a SQL table [SRSinvoiceDetail] where the variable (@InvoiceNo) equals an existing value (PND_INVNO) in the table. The query is giving me an 'incorrect syntax near the keyword WHERE' error, and I can't figure out why.
Declare @InvoiceNo as Int =:InvoiceNo
Declare @RefNum as Int =:RefNum
INSERT INTO SRSinvoiceDetail
I would appreciate help in correcting the query or the procedure.