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
 Transact-SQL (2005)
 Output to a text file

Author  Topic 

hisouka
Starting Member

28 Posts

Posted - 2009-05-11 : 03:55:24
Hi I have a Query:

SELECT * FROM TABLE

I want to ouput the result in a text file. How can i do that?

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-11 : 04:02:16
use BCP, SQLCMD etc

Check the Books online for more details

http://msdn.microsoft.com/en-us/library/ms162802(SQL.90).aspx
http://msdn.microsoft.com/en-us/library/ms162773.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-05-11 : 04:13:03
Also

1 Import/Export wizard
2 OPENROWSET

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

NeilG
Aged Yak Warrior

530 Posts

Posted - 2009-05-11 : 05:11:06
if you look at the top of the SSMS there is an option to "Return results to file" then you can save this as a text file.
Go to Top of Page
   

- Advertisement -