DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    manisha Guest

    how do u delete temp tables


    Please tell me how to delete temporary tables

  2. #2
    Q*bert Guest

    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



  3. #3
    Marian Olteanu Guest

    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



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links