Home All Groups Group Topic Archive Search About

MSSMSE: Save Results As...: tab separated?

Author
30 Oct 2007 5:35 PM
Robert
Hi--

I just started to work with Microsoft SQL Sever Management Studio Express
(2005). The File menu gives me the option to Save Results As... to output my
query results, but the results come out as CSV which is causing problems (a
lot of commas in our data fields). I'd like to tell it to use tab-separated
values, but I can't find any option that will allow me to do that.

Is it impossible?

Thanks-- Robert

(Config details: Microsoft SQL Server Management Studio Express, SQL Server
2005, Windows XP Professional on a dual Intel MacBookPro via Parallels
Desktop)

Author
30 Oct 2007 6:28 PM
Andrew J. Kelly
I don't have a copy of SSMS Express but if that is not an option directly
you can copy the results from the Grid view into a spreadsheet and save it
any way you wish from there.

--
Andrew J. Kelly    SQL MVP
Solid Quality Mentors


Show quote
"Robert" <Rob***@discussions.microsoft.com> wrote in message
news:AAB48393-3AB0-435C-BBD4-C16CB46869CC@microsoft.com...
> Hi--
>
> I just started to work with Microsoft SQL Sever Management Studio Express
> (2005). The File menu gives me the option to Save Results As... to output
> my
> query results, but the results come out as CSV which is causing problems
> (a
> lot of commas in our data fields). I'd like to tell it to use
> tab-separated
> values, but I can't find any option that will allow me to do that.
>
> Is it impossible?
>
> Thanks-- Robert
>
> (Config details: Microsoft SQL Server Management Studio Express, SQL
> Server
> 2005, Windows XP Professional on a dual Intel MacBookPro via Parallels
> Desktop)
Author
30 Oct 2007 10:20 PM
Erland Sommarskog
Robert (Rob***@discussions.microsoft.com) writes:
> I just started to work with Microsoft SQL Sever Management Studio
> Express (2005). The File menu gives me the option to Save Results As...
> to output my query results, but the results come out as CSV which is
> causing problems (a lot of commas in our data fields). I'd like to tell
> it to use tab-separated values, but I can't find any option that will
> allow me to do that.

And in addition to Andrew's post, there is an option for grid mode "Include
headers when copying data" which is very useful.

Also, you don't have to copy into Excel, you can copy into a text file.
It will still be delimited.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
31 Oct 2007 5:54 PM
NigelA
It is a problem. SSMS (and I assume by extrapolation SSMSE) is useless from
this point of view. You can't even stop it from saving in unicode format
which Excel doesn't understand and treats everything as a single column!

I have however had good results by selecting all in the results grid and
copying and pasting into Excel.

Nigel Ainscoe


Show quote
"Robert" <Rob***@discussions.microsoft.com> wrote in message
news:AAB48393-3AB0-435C-BBD4-C16CB46869CC@microsoft.com...
> Hi--
>
> I just started to work with Microsoft SQL Sever Management Studio Express
> (2005). The File menu gives me the option to Save Results As... to output
> my
> query results, but the results come out as CSV which is causing problems
> (a
> lot of commas in our data fields). I'd like to tell it to use
> tab-separated
> values, but I can't find any option that will allow me to do that.
>
> Is it impossible?
>
> Thanks-- Robert
>
> (Config details: Microsoft SQL Server Management Studio Express, SQL
> Server
> 2005, Windows XP Professional on a dual Intel MacBookPro via Parallels
> Desktop)
Author
31 Oct 2007 11:24 PM
Erland Sommarskog
NigelA (discussion@microsoft.newsgroups) writes:
> It is a problem. SSMS (and I assume by extrapolation SSMSE) is useless
> from this point of view. You can't even stop it from saving in unicode
> format which Excel doesn't understand and treats everything as a single
> column!

Hold it! I and Andrew spoke to soon!

When you save the file, in the Save dialog there is an arrow next to the
Save button. If you click this arrow, you can select Save with Encoding.
This opens a small dialog and here you can select wether to save as
Unicode or ANSI. And, drum roll! You can make a selection between
Tab Delimited and Comma-Separated.

Of course, if you do this often, it's still probably quicker to copy
and paste into Excel.

I should add that I found this in the "big" SSMS. I cannot vouch for
that this is availale in SSMS Express, but I would guess that it is.
Just make sure that you have SP2 of SSMS Express. SP2 added quite a
few features to SSMS and SSMS Express.


One final note: Excel can do Unicode just fine. I tested with Excel 2007,
but I think you would need a very old Excel version to get an Excel
that does not understand Unicode.




--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
1 Nov 2007 9:28 AM
NigelA
Hey Erland - well spotted. They hid that well didn't they!

I thought it was bizarre that the encoding couldn't be changed.

Thanks for that, I'm glad I had a moan now.

Cheers,
Nigel


Show quote
"Erland Sommarskog" <esq***@sommarskog.se> wrote in message
news:Xns99DB55EBF9F3Yazorman@127.0.0.1...
> NigelA (discussion@microsoft.newsgroups) writes:
>> It is a problem. SSMS (and I assume by extrapolation SSMSE) is useless
>> from this point of view. You can't even stop it from saving in unicode
>> format which Excel doesn't understand and treats everything as a single
>> column!
>
> Hold it! I and Andrew spoke to soon!
>
> When you save the file, in the Save dialog there is an arrow next to the
> Save button. If you click this arrow, you can select Save with Encoding.
> This opens a small dialog and here you can select wether to save as
> Unicode or ANSI. And, drum roll! You can make a selection between
> Tab Delimited and Comma-Separated.
>
> Of course, if you do this often, it's still probably quicker to copy
> and paste into Excel.
>
> I should add that I found this in the "big" SSMS. I cannot vouch for
> that this is availale in SSMS Express, but I would guess that it is.
> Just make sure that you have SP2 of SSMS Express. SP2 added quite a
> few features to SSMS and SSMS Express.
>
>
> One final note: Excel can do Unicode just fine. I tested with Excel 2007,
> but I think you would need a very old Excel version to get an Excel
> that does not understand Unicode.
>
>
>
>
> --
> Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
1 Nov 2007 12:45 PM
Andrew J. Kelly
Thanks Erland.  I figured this was an Express issue but I guess I should
have dug further to make sure.

--
Andrew J. Kelly    SQL MVP
Solid Quality Mentors


Show quote
"Erland Sommarskog" <esq***@sommarskog.se> wrote in message
news:Xns99DB55EBF9F3Yazorman@127.0.0.1...
> NigelA (discussion@microsoft.newsgroups) writes:
>> It is a problem. SSMS (and I assume by extrapolation SSMSE) is useless
>> from this point of view. You can't even stop it from saving in unicode
>> format which Excel doesn't understand and treats everything as a single
>> column!
>
> Hold it! I and Andrew spoke to soon!
>
> When you save the file, in the Save dialog there is an arrow next to the
> Save button. If you click this arrow, you can select Save with Encoding.
> This opens a small dialog and here you can select wether to save as
> Unicode or ANSI. And, drum roll! You can make a selection between
> Tab Delimited and Comma-Separated.
>
> Of course, if you do this often, it's still probably quicker to copy
> and paste into Excel.
>
> I should add that I found this in the "big" SSMS. I cannot vouch for
> that this is availale in SSMS Express, but I would guess that it is.
> Just make sure that you have SP2 of SSMS Express. SP2 added quite a
> few features to SSMS and SSMS Express.
>
>
> One final note: Excel can do Unicode just fine. I tested with Excel 2007,
> but I think you would need a very old Excel version to get an Excel
> that does not understand Unicode.
>
>
>
>
> --
> Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button