I have several stored procedures that first delete, then populate a global temp table called ##DataOutput
. That is not all that the stored procedures do - just at some point of their process, they must populate this global table with some data, that other processes will be using.
The structure of ##DataOutput
can change a little, it's not always the same.
Even though the table is being dropped at the beginning, sometimes SQL Server shows an error when calling a stored procedure, because it expects column C (for example) that is going to be generated in the current stored procedure, but was not in the last stored procedure (that is, currently the global temp table ##DataOutput
does not have column C).
Is there a way to prevent SQL Server for checking these tables prior to executing, since this table is deleted at the beginning of the stored procedure?
I know that using EXEC
would make it dynamic, but I'd like to check any other options.
Thank you.