Hi,
I am using a temp table in a stored procedure, I need to pass the column list to it
I am passing the sql statement using this parameter
@ReportSQL varchar(1000)
The problem is I can not use this parameter in the following statement
INSERT INTO #TempVouchers(serial_num, Name, Address, MID, CID)
SELECT @ReportSQL
Following is the error message I am getting:
"The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns."
How can I solve this issue?
Thanks!
I am using a temp table in a stored procedure, I need to pass the column list to it
I am passing the sql statement using this parameter
@ReportSQL varchar(1000)
The problem is I can not use this parameter in the following statement
INSERT INTO #TempVouchers(serial_num, Name, Address, MID, CID)
SELECT @ReportSQL
Following is the error message I am getting:
"The select list for the INSERT statement contains fewer items than the insert list. The number of SELECT values must match the number of INSERT columns."
How can I solve this issue?
Thanks!