Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Export query to txt.

Author  Topic 

Moishy Goldberg
Starting Member

4 Posts

Posted - 2009-04-23 : 13:10:11
how do i export a query in SQL 2005 to a txt.

nr
SQLTeam MVY

12543 Posts

Posted - 2009-04-23 : 13:38:54
Do you mean the results or the query itself?
I suspect the results.
Query, results to, results to file
or ctrl alt F

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Moishy Goldberg
Starting Member

4 Posts

Posted - 2009-04-23 : 13:42:52
i would like to export the results to a txt file. i am a bit new to this, so please be a bit more specific. thank you
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2009-04-23 : 13:52:01
In the menu select Query, Results to, Results to file.
Now when you run the query it will prompt for a filename.

If you want to do it inn an SP see
http://www.nigelrivett.net/SQLTsql/WriteTextFile.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Moishy Goldberg
Starting Member

4 Posts

Posted - 2009-04-23 : 14:12:34
in my version of SQL there is only a query designer and there is no result to option. thank you
Go to Top of Page
   

- Advertisement -