>From Books Online (SQL Server 2000):
Local temporary tables have a name that starts with #. Global temporary
tables have a name that starts with ##.
Temporary tables are automatically dropped when they go out of scope,
unless explicitly dropped using DROP TABLE:
A local temporary table created in a stored procedure is dropped
automatically when the stored procedure completes. The table can be
referenced by any nested stored procedures executed by the stored
procedure that created the table. The table cannot be referenced by the
process which called the stored procedure that created the table.
All other local temporary tables are dropped automatically at the end of
the current session.
Global temporary tables are automatically dropped when the session that
created the table ends and all other tasks have stopped referencing them.
The association between a task and a table is maintained only for the life
of a single Transact-SQL statement. This means that a global temporary
table is dropped at the completion of the last Transact-SQL statement that
was actively referencing the table when the creating session ended.
Thanks,
Eric
"Bradford T Comer" <[EMAIL PROTECTED]>
09/08/2003 02:14 PM
Please respond to sql
To: SQL <[EMAIL PROTECTED]>
cc:
Subject: ##TmpTables
Can anyone tell me now, before I test myself and waste the time doing so,
if
I have a job that executes 1 sp, within this sp, i create a ##TmpTable, if
I
fire another SP at the end of the first, will the ##TmpTable still exist
for
use within the second SP?
That make sense?
Brad
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:6
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:6
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=<:emailid:>.<:userid:>.<:listid:>
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community.
http://www.fusionauthority.com/ads.cfm