November 22nd, 2010
Woops!! I filled up my tempdb!
Being the best adhoc T-SQL developer this side of my keyboard, I can whip up a report for a manager in no time.
So, sit down and let me tell you a story…
The request came in one day, management needed information…
I had to call functions that call functions that loop through tables. Yah!! Kinda like a really cool roller coaster.
What was that noise? I think my database administrator just passed out. Poor guy.
By the way: I rewrote the query.. it’s fine now. I may run the little guy again next month.
But ANYWAY…my POINT is I filled up the tempDB… panic set in… I posted to twitter… I googled… I asked questions and felt like a total noob. How could this be? MY query is finished…shouldn’t the temp data have poofed when it died?
Nope.
I found this at Microsoft support
But come on, you cant stop and start a production SQL Server, and really, I needed more coffee to deal with that. I wasn’t happy….
On a whim (get it? yeah I’m here all week folks) I decided that it had to be tied to my spid… I could disconnect my session or kill my spid and any temp objects I was working with in tempdb should go away. It worked!
I reconnected and yes… the tempdb was back down to a reasonable size.
Whew!
Lesson learned… if I blow up tempdb, disconnect all sessions and hide… er I mean reconnect and see if that fixed it before stopping/starting sql server.
I’m not saying this is the right way, but it’s what worked for me.
Now go have a good Monday. :)

Arlene Gray began her Microsoft SQL Server career in 2001 at MarketLinx Solutions (now 