Temporary tables in Management Studio treeview

  • In the Object Explorer of Management Studio, if I open the treeview down to Databases/System Databases/tempdb/Temporary Tables, I see a random number of # tables.

    Those tables are not the ones created by a CREATE TABLE #TABLENAME command. And I can't get any information on them with a right click of the mouse or by sp_help.

    What are they for and how can I see the content/size?

    Thank!

    ___________________________________
    I love you but you're standing on my foot.

  • They can be any number of things. Lots of resources use tempdb within SQL Server, sort operations, table spools, hash joins, cursors, lots of stuff. You'll see that encrypted name, even for the tables you create as temporary tables. To see which ones are using the most space you can hit the DMV's, sys.dm_db_task_space_usage or sy.dm_db_session_file_usage.

    There's a whole section on tempdb in the books online.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply