December 22, 2008 at 9:15 pm
How to export the results of the system stored procedure into text file.
I tried
bcp "xp_readerrorlog 1" out "c:\file.txt" -T -c
but it dint work... please help me out...
thanks,
sid
December 22, 2008 at 9:17 pm
Use sqlcmd instead. It can send all output to a file.
December 22, 2008 at 9:24 pm
could you please help me with the code??? I dont know how sqlcmd works...
thanks,
sid
December 23, 2008 at 2:55 am
siddalingaswamyd (12/22/2008)
could you please help me with the code??? I dont know how sqlcmd works...thanks,
sid
try like:
sqlcmd -E -Q "exec xp_readerrorlog 1" -o "C:\out.txt"
it works fine.
December 23, 2008 at 6:13 am
For the full list of sqlcmd settings and commands, please consult the Books Online.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply