Home Forums SQL Server 7,2000 T-SQL How to write query result in an output file in T-SQL (MSDE) RE: How to write query result in an output file in T-SQL (MSDE)
SQL_ABD
SSCertifiable
Points: 5832
More actions
November 21, 2007 at 7:40 am
#753105
Hi,
You can use xp_cmdshell to execute from a stored proc
Exec master..xp_cmdshell 'osql -E -d NOMADE -S (local) -Q ''select * from MyTable where ...'' -o C:\File.txt'