Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL TMP Tables and VB

Author  Topic 

kamalkishore_in
Yak Posting Veteran

76 Posts

Posted - 2002-10-07 : 00:01:50
Hello,

I am creating #TMP table within my VB Code. And I need to know weather this #TMP table is already existed or not.

What is the SQL command to find a #table exited or not.

Thankx

Andraax
Aged Yak Warrior

790 Posts

Posted - 2002-10-07 : 04:01:35
Hi!

You can use the object_id function in the manner demonstrated below:


if object_id('tempdb..#tmp') is null
print 'Table does not exist'
else
print 'Table exists!'


Go to Top of Page
   

- Advertisement -