March 29, 2002 at 11:16 am
How do I test for tmp tables??? I want to test if the tmp table exists if so drop tmp table.
Steve Johnson
Steve Johnson
March 29, 2002 at 3:38 pm
The following will work for you;
if exists
(
select name from tempdb..sysobjects where name like '#YourTable%'
)
drop table #YourTable
Hope this helps.
David
David
@SQLTentmaker“He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot
April 8, 2002 at 10:30 am
Thanks David that will work great!!!
Steve Johnson
Steve Johnson
April 9, 2002 at 8:33 am
There's an easier statement:
if not OBJECT_ID('#TableName') is Null
and so on.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply