Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2004, 02:53 AM
Authorized User
 
Join Date: Dec 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sasidhar79
Default SQL to Text

Hi All,

I want to export a rsultset of an sql query to a text file, from the query analyser, can you please help me in this aspect.


regards
Sasidhar

thanks,
Sasidhar
__________________
thanks,
Sasidhar
 
Old June 22nd, 2004, 07:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You mean to help you in copy paste the result from query analyser?

Try this.

Use CTRL + D to have results in GRID.
Once you execute the query in sql QA, Select the result and can right click to choose SAVE SELECTION, which saves the result in CSV format.

Is that what you are looking for?

Hope that helps.
Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 22nd, 2004, 07:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

You can also copy/paste from the results screen to a text file.

Brian
 
Old June 22nd, 2004, 07:35 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there a way to include the column headings, using this method?

 
Old June 22nd, 2004, 08:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Then you got to use TEXT mode for result pane (CTRL + T). Execute the query and copy/paste from the result pane to a text file. This includes the column heading too.

PS : But SAVE SELECTION option would not appear when using TEXT result mode

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 22nd, 2004, 09:19 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for this,
Notepad was the missing piece, I was pasting the results straight into Excel and getting the results all in one column.

Thanks

 
Old June 22nd, 2004, 09:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you paste in Excel, use Grid mode, but you got to compromise on missing the column header part.

If you use notepad, text mode is the right thing to have column header part too in it.

Cheers!


_________________________
-Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Text(Sql Server Text Field) to Image(JPG) srinivas72 ADO.NET 2 February 13th, 2009 06:31 PM
SQL Text to Date Conversion Neal SQL Server 2000 9 April 17th, 2007 01:44 PM
Problems with Text driver and SQL jrogers SQL Language 3 April 10th, 2006 05:33 AM
SQL Text Datatype bekim ASP.NET 1.0 and 1.1 Professional 2 March 28th, 2006 12:05 AM
sql to text file [email protected] Biztalk 0 October 8th, 2004 12:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.