My Work
My Blogs
Hotlinks
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 automation, backup, bat, batch, batch file, cli, cmd, command line, cursor, DECLARE, del, exec, fetch, fetch_status, information_schema, kill, restore, sproc, SQL, sqlcmd, sys, tsql, workflow
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 coalesce, dynamic sql, exec, pivot, quotename, SQLSERVER, table variable, tsql
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 exec, mssql, mssql2000, mssql2005, scope, SELECT INTO, table variable, temp table, tsql
1 Comment
