DevelopmentNow Blog

SQL Server Management Studio – Export Query Results to Excel

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.

DevelopmentNow is a new media consulting company that specializes in building integrated mobile web solutions and native apps. For more information on mobile web technology and the services we offer, give us a call at 800.284.3961, or email sales@developmentnow.com.
This entry was posted in Database, Tools. Bookmark the permalink.
  • Ronaldo Biagini

    Great!!!
    Simple and functional!

  • http://www.outsource-website-design.com website outsourcing

    Thanks for your blog posting.your blog provides much ideas behind online share market.you keep updating such a post.

  • http://www.webhostings.in/ web hosting companies

    Above the information are explained very clearly.Most of the people looking for this kind of valuable tips.

  • http://www.register-domainname.in/ Register domain name

    What a wonderful article? but I am not that much familiar with sql. Now only I have read to gather some knowledge. Thanks for sharing.

  • http://www.webhostings.in/ web hosting companies

    I am new guy for this SQL field.I get it clear information through this blog.

  • http://www.seopositiveltd.co.uk/link-building.php Sarah

    You have manage & compile really a unique information.I like this.I would like to read your more updates in future too.Keep in touch with us in future too.

  • http://www.mgtdesign.co.uk/ Zena

    I get it clear idea about your topic.Most of the people looking this kind of valuable tips.
     

  • http://www.seopositiveltd.com/pay-per-click-management/ Katie

    Nice tutor.Your way of representation is too good. I have  just bookmarked this page so I don’t miss any more of these. Thanks for this post.Keep it up.

  • http://www.linkbuildingservices.com/ William

    Well written article.I appreciate your writing skills.Its great.You have done a good job by sharing this post with us.I hadn’t thought of some of these Interesting piece. It can be difficult to find good blogs nowadays. Found one here though by the looks of things.

  • http://www.webhostings.in/ hosting server

    Most of the people looking for this kind of valuable tips.Great information posted here.

blog comments powered by Disqus