Tag Archives: exec

Today I took 30 minutes to save hours

UPDATE – 1/6/2011 : Since writing this post I have bundled this entire reset process into a single windows batch file. In addition to restoring my database, I also have to remove temp files from my server, so it was … Continue reading

Posted in database, development, SQL, tips and tricks | Tagged , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

What if you want to PIVOT against a text column?

If you’ve ever worked with or researched SQL Server’s PIVOT function, you probably noticed most of the samples pivot against an id column.  Typically an int column like EmployeeID, or StoreID.  That’s fine and dandy, but what happens when you … Continue reading

Posted in database, microsoft, SQL, tips and tricks, tsql | Tagged , , , , , , , | 2 Comments

What happens in EXEC, stays in EXEC. Lifespan of a MSSQL table variable

One of my all time favorite features of MSSQL 2005+ is being able to create table variables on the fly from SELECT statements. This isn’t a lesson in what table variables are, but here is an easy sample in case … Continue reading

Posted in database, development, tsql | Tagged , , , , , , , , | 1 Comment