Home Forums SQL Server 2008 T-SQL (SS2K8) Table variable is not automatically dropped in TempDB RE: Table variable is not automatically dropped in TempDB

  • Yes, it's an optimisation, SQL caches the definition and a single data page to reduce the work required to recreate it. The table variable's effectively gone, you cannot access it in any way, there's just a shell cached for future use.

    Why is it a concern?

    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