September 13, 2011 at 6:29 am
How to save a query result in a readable format.
select * from sys.databases
Thanks
September 13, 2011 at 6:33 am
I usually just copy-and-paste into Excel for that kind of thing.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
September 13, 2011 at 6:33 am
forsqlserver (9/13/2011)
How to save a query result in a readable format.select * from sys.databases
Where do you want to save it? In a file? And, what do you mean by "readable format"? Plain text? HTML? ???
--Jeff Moden
Change is inevitable... Change for the better is not.
September 13, 2011 at 11:19 am
If you want to save the SQL query result into Excel,
you can use this handy tool.
September 13, 2011 at 11:58 am
You can right click in the upper left cell of the headers in results and select "select all" and then "save as". You'll get a CSV loadable into Excel.
September 13, 2011 at 1:15 pm
Steve Jones - SSC Editor (9/13/2011)
You can right click in the upper left cell of the headers in results and select "select all" and then "save as". You'll get a CSV loadable into Excel.
Or, you can Ctr + Shift + F 😉
September 13, 2011 at 11:40 pm
Dear All, Thanks
As you know on servers excel doesn't exist.I have tried it option (Save to file) and saved in .rpt,.csv,.xls,.txt still finally it was opening on my system as not in readble format.
Thanks
September 13, 2011 at 11:51 pm
You could use the SSIS Export Wizard.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
September 14, 2011 at 12:04 am
forsqlserver (9/13/2011)
Dear All, ThanksAs you know on servers excel doesn't exist.I have tried it option (Save to file) and saved in .rpt,.csv,.xls,.txt still finally it was opening on my system as not in readble format.
You need to finish the rest of the story... what are you trying to read it with?
--Jeff Moden
Change is inevitable... Change for the better is not.
September 14, 2011 at 5:18 am
forsqlserver (9/13/2011)
Dear All, ThanksAs you know on servers excel doesn't exist.I have tried it option (Save to file) and saved in .rpt,.csv,.xls,.txt still finally it was opening on my system as not in readble format.
I'm used to connecting with SSMS from a workstation. Are you RDPing in to the server or something like that? If so, you can share the clipboard via the RDP options interface, and still copy and paste from server to workstation. Easy enough to put Excel or the Open Office spreadsheet program on the workstation, and then you're good to go.
Or are you in the server room, working directly on the server? If so, that's an odd and rare arrangement. If that's the case, then your best bet is right-click the server in the object explorere in SSMS and select Tasks ... Export data, and then you can save query results to a format that you like.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
September 15, 2011 at 5:59 am
Jeff Moden (9/14/2011)
forsqlserver (9/13/2011)
Dear All, ThanksAs you know on servers excel doesn't exist.I have tried it option (Save to file) and saved in .rpt,.csv,.xls,.txt still finally it was opening on my system as not in readble format.
You need to finish the rest of the story... what are you trying to read it with?
Gosh... I'll ask one more time...
What do you want to see as a "readable format"?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply