Welcome to SqlAdvice Sign in | Join | Help

September 2007 - Posts

Archive and Compress Data from SQL Server

I recently blogged about deleting off data from a table by looping through one day at a time. Strangely enough I had a similar need pop up a few days later although this time I wanted to keep the data around just in case I need it later. I really didn't
Posted by gstark | 2 Comments

Enable XP_CMDSHELL in SQL Server 2005

I needed to use xp_cmdshell recently and discovered that it isn't on by default on SQL Server 2005. I had to dig a bit to find out how to enable it. The code is very simple. Figured I would blog it here so I can easily find it next time. EXECUTE sp_configure
Posted by gstark | 2 Comments

Iterate Over a List of Dates using a Numbers table in SQL

Recently I was helping Steve archive off a bunch of data from one of his tables. Unfortunately he didn't have a ton of diskspace to use some of the techniques I normally would. Steve recently posted a solution using powershell to do this. I told him about
Posted by gstark | 8 Comments

Remove Extra Spaces when Pasting from Outlook to Sql Server Management Studio

I seem to have this problem that when I paste sql code from my email into Sql Server Management Studio that it doubles all the line breaks and I have to go and remove them all. Most of the time this isn't a big deal because the Sql is only a couple lines.
Posted by gstark | 2 Comments

Retrieve File Contents using SQL Server 2005 SQL CLR

I recently had a need to load a bunch of pdf files into my database. The problem was that the directory the files were in contained a bunch of other pdf files that I didn't want or that were no longer needed so I couldn't just upload every PDF in the