A DBA accidentally added an extra TempDB file and was not allowed to use SSMS to undo it. Here is how to remove a TempDB file with T-SQL only.
Create a Global Temporary Table in SQL Server
A global temporary table starts with two # signs, lives in tempdb, and any session can read it. This post creates one, reads it from a second window, and shows when SQL Server drops it. It also covers name collisions and the cases where a different table type is the better choice.
SQL SERVER – How to Create Table Variable and Temporary Table?
A Temporary table uses CREATE TABLE, while a table variable uses DECLARE. I use one row in each beginner example.
What is the Initial Size of TempDB? – Interview Question of the Week #120
Question: What is the Initial Size of TempDB? Trust me, this question is way more complicated than you read in one line.
SQL SERVER – Unable to Start SQL Service – OS Error 5 (Access is denied.) for TempDB
I moved TempDB files and SQL Server would not start, with OS Error 5 (Access is denied). The message was misleading, and here is the real mistake.
SQL SERVER – DBCC SHRINKFILE: Page 1:26423878 Could not be Moved Because it is a Work Table Page – TempDB Files
Shrinking TempDB kept failing: DBCC SHRINKFILE said the page could not be moved because it is a work table page. Here is the workaround that helped.
SQL SERVER – Script to Find and Monitoring TempDB Space Usage
A client’s TempDB log grew to 80 GB while the data file was 5 GB. Here is the script I used for monitoring TempDB Space usage and finding the cause.






