Hi,
I'm using a stored procedure with some SQL strings and EXEC statements. In the SQL string, I'm updating tables with code like this:
'SELECT * INTO #temp1 FROM '+@sql_location_from+' WHERE row_identifier = @parameter '+'INSERT INTO '+@sql_location_to+' SELECT * FROM #temp1'
I need to loop thru the table from within the SQL statement and update several rows. I get an error message saying:
"There is already an object named '#temp1' in the database."
Do I need to reset the #temp1 somehow? If so, how?
Thanks for any help.
I'm using a stored procedure with some SQL strings and EXEC statements. In the SQL string, I'm updating tables with code like this:
'SELECT * INTO #temp1 FROM '+@sql_location_from+' WHERE row_identifier = @parameter '+'INSERT INTO '+@sql_location_to+' SELECT * FROM #temp1'
I need to loop thru the table from within the SQL statement and update several rows. I get an error message saying:
"There is already an object named '#temp1' in the database."
Do I need to reset the #temp1 somehow? If so, how?
Thanks for any help.