hi
Writing to text file from table/view is done using osql,bcp etc. How do we write output of stored procedure into text file
Thank you
hi
Writing to text file from table/view is done using osql,bcp etc. How do we write output of stored procedure into text file
Thank you
Writing to text file from Stored Procedure
progchris
Stephen C. Steel
SQLCMD, ISQL, or OSQL will work..
With SQLCMD, you can do this to export a query (the query can be anything):
sqlcmd -S.\yukon -E -Q "select * from sys.dm_exec_requests" -s, -W
-S ServerName
-E Trusted Connection
-Q Run the following query and exit
-s Seperator
-W Remove trailing spaces
Laxmi.
..and then of course the -o switch for the ouput file.
(..) -o C:\SomeOutputdata.txt
HTH, jens Suessmeyer.