Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting a temporary table 1

Status
Not open for further replies.

cmdematos

IS-IT--Management
Mar 7, 2001
29
US
I want to fire some SQL statements at a global temporary table, but if the table does not exist I want to create it first.

How can I detect the presence of a temporary table?
 
by using the exists command...

if exists (select name from tempdb..sysobjects where name like '##temptable%')
print 'it exists'
else
print 'does not exists' Andel
andelbarroga@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top