Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I check if a temp table exists?
Message
De
01/11/2002 09:04:18
 
 
À
31/10/2002 19:07:44
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00717635
Message ID:
00717757
Vues:
18
>I am creating some #temp temp tables conditionally. I am doing a insert into #mytemptable, which creates the table. How can I check if the table exists. With a regular table I can do the statement:
> if exists (select from dbo.sysobjects...)
>
>but this doesn't seem to work for a #temp table. HOw can I find out if a given temp table already exists?
>
>TIA

IF object_id(tempdb..#tablename) IS NOT NULL
PRINT 'The table exists.'
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform