How to drop global ##temp_tbl if exist, but if not don't drop.
When I try to run sp second time it says:
There is already an object named '##temp_tbl' in the database.
If I add into sp drop table '##temp_tbl' and try to run in a while it says:
Cannot drop the table '##temp_tbl', because it does not exist in the system catalog.
I need to have global ##temp_tbl not local #temp_tbl
Please help.
When I try to run sp second time it says:
There is already an object named '##temp_tbl' in the database.
If I add into sp drop table '##temp_tbl' and try to run in a while it says:
Cannot drop the table '##temp_tbl', because it does not exist in the system catalog.
I need to have global ##temp_tbl not local #temp_tbl
Please help.