Hi,
I am trying to drop a global temp table (##table) with sa rights and I get no joy. Does anyone have an idea what this could be caused by. The table is used by a sp which checks if the table is there and it drops it if its there.
Tnx for help.
Hi Kudah
Just tested creating,selecting from and dropping a global temp tabl;e with no issues. Your best bet is to post the code of the SP if possible and if not the ## table creation script and any supporting error messages.
Cheers
Charl
|||Are you getting an error message? Can you post part of the code?
Normally this shouldn't be an issue.
|||create table ##a(name varchar(90))
select * from tempdb.##aa
if (select count(*) from tempdb..sysobjects where name='##a' ) > 0
print 'table is available'
else
print 'table dropped'
The above should give you proper results
-srikanthr
|||Quite possible that another user might be accessing the ##table since it is a global temporary table.