I am using a temp table in my sp. I have written the following tsql before and after using the temp table.
IF OBJECT_ID('tempdb..##TEMP') IS NOT NULL DROP TABLE tempdb..##TEMP;
Data will be inserted to the temp table consecutively using a cursor. I use SELECT * INTO tempdb..##TEMP
FROM EXEC('query') to fill this temp table for the first time and INSERT INTO tempdb..##TEMP(<fields>) EXEC('query') for the remaining times.
The SP is working fine in my laptop, but I am getting an Invalid Object error on this temp table name in the production server. Could anyone tell me the possible causes please?
View Complete Post