Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function To Test For Table Doesn't Work
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01328338
Message ID:
01328544
Vues:
11
>A Temp table only exists for the current session, correct? Is there any reason to put a DROP statement in there then?

When a local temp table will be dropped depends on where it's created. If it is created in a stored procedure, it'll be dropped when SP ends. Otherwise it'll be dropped at the end of the current session.
You can create a temp table in SP with the same name as temp table that exists before SP is called. It's not defined in T-SQL which one will be referenced inside the SP.
To be safe, I always drop a temp tables at the beginnig and end of any SP that uses temp tables.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform