Home Forums SQL Server 2005 Administering How to remove temporary tables in tempdb database RE: How to remove temporary tables in tempdb database

  • The temp table will be dropped as soon as the procedure that created it ends, whether it ends successfully or not does not matter. There's nothing you need to do, the temp tables are cleaned up automatically.

    There's no way to identify which session created a temp table and you cannot drop one that you did not create.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass