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.
Author |
Topic |
rama108
Posting Yak Master
115 Posts |
Posted - 2013-10-25 : 15:00:59
|
I have a sql statement in a variable and I want to print that variable to a text file. How to do that?Thanks. |
|
rama108
Posting Yak Master
115 Posts |
Posted - 2013-10-25 : 15:26:27
|
I found the answer:EXEC XP_CmdShell 'BCP "select * from table;" queryout"C:\outputfilename.txt" -c -T ' |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
rama108
Posting Yak Master
115 Posts |
Posted - 2013-10-26 : 09:29:33
|
Thank you Vishakh. |
|
|
|
|
|