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 2000 Forums
 Transact-SQL (2000)
 output to a file

Author  Topic 

jamie
Aged Yak Warrior

542 Posts

Posted - 2005-05-10 : 04:49:37
hi, I am running a query from QA. but instead of clicking on the icon for results to file is it possible to code it ?
eg :
SELECT * FROM TABLE
OUTPUT TO C:\Table_Data.txt


thank you for any info.
Jamie

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-10 : 05:47:42
exec xp_cmdshell 'bcp "select * from table" queryout "C:\table_data.txt" -c'

Madhivanan

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

jamie
Aged Yak Warrior

542 Posts

Posted - 2005-05-10 : 07:01:37
thank you!
Go to Top of Page
   

- Advertisement -