Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where are my temporary tables?
Message
 
 
À
19/12/2004 07:37:34
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Divers
Thread ID:
00970374
Message ID:
00970413
Vues:
19
Alan,

You can use OBJECT_ID() function
IF OBJECT_ID('tempdb..#mytemptable')IS NOT Null
  -- Temp.table exists
  DROP TABLE mytemptable
A local temporary table is only visible to the the current session and will be droped at the end of the session. However if it's created in a stored procedure/trigger than it'll be droped as soon as stored procedure/trigger completes. For more details see Temporary Tables section in the CREATE TABLE topic in BOL.

>In the T-SQL window I have created some temporary tables using the syntax
>
>SELECT * INTO #MyTempTable FROM MyTable.
>
>Where can I find what temporary tables are currently available (I don't want to delete them yet using DROP TABLE ...)? I cannot find them in any enterprise mgr. table listing. Is it stored in memory like a VFP temporary cursor? What is the scope of these 'tables'? Are they present until the SQL session finishes?
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform