DevelopmentNow Blog
 Monday, April 07, 2008

The easiest way I've found involves two steps:

Adjust SSMS Settings

  1. Go to Tools->Options
  2. Query Results->SQL Server->Results to Grid
  3. Check "Include column headers when copying or saving results"
  4. Click OK.
  5. Note that the new settings won't affect any existing Query tabs -- you'll need to open new ones and/or restart SSMS.

Now next time you run a query, do this

  1. Make sure the results are displayed in a grid (CTRL+D or Query->Results To->Results to Grid)
  2. Right click in the grid, and click Select All
  3. Right click in the grid again & click Copy
  4. Open up a new Excel spreadsheet, and paste the data in
  5. Do a global search & replace, replacing "NULL" with an empty string.

Voila!

I had tried before with SSMS's export to CSV feature, and it just didn't escape data the way I needed it to.

April 7, 2008    Bookmark to Digg or other social bookmarking
#    Disclaimer  |  Comments [0]

Related posts:
Cool Buttons for Programmers
Lightweight Remote MySQL Database Access
How to Disable AVG Antivirus in Vista
Subversion: Merging Changes from a Branch into the Trunk
Office Live Workspace now Open
Mac Subversion Clients


« Linq to SQL: Cast Stored Procedure Resul... | Main | Portland Open Beer Club is this Thursday... »