-
how do u delete temp tables
Please tell me how to delete temporary tables
-
Re: how do u delete temp tables
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.
Generally a temp table only exists for the duraion of the SP/View running
it so you don't have to drop/delete it.
"manisha" <manishad@ludusonline.com> wrote:
>
>Please tell me how to delete temporary tables
-
Re: how do u delete temp tables
The same way you delete regular tables:
drop table #connection_dependent_temptable
or
drop table ##connection_independent_temptable
"manisha" <manishad@ludusonline.com> wrote:
>
>Please tell me how to delete temporary tables
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks