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)
 query reslut to text file

Author  Topic 

js.reddy
Yak Posting Veteran

80 Posts

Posted - 2008-03-25 : 08:33:38
I want to store the SelectQuery result in a text file.

I have given this query
SELECT * FROM xxx OUTPUT TO 'd:\xxx.txt'

but this error is comming
Incorrect syntax near the keyword 'TO'.

can any one help me please!

Regards
Js.Reddy

elancaster
A very urgent SQL Yakette

1208 Posts

Posted - 2008-03-25 : 08:46:51
isn't "OUTPUT TO" sybase? is it actually SQL Server you're asking about?

Em
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-03-25 : 14:31:27
You have a option in your query analyser/sql server management studio to save results to text file. On executing query it will ask for where the file is to be saved.
Go to Top of Page
   

- Advertisement -