October 29, 2007 at 6:39 pm
Is there a way to have the output from :ServerList redirected to a file?
I tried :ServerList -o C:\Test.txt
and
:serverlist :Out C:\Test.txt
Tks.
December 18, 2007 at 6:53 am
Hi John,
I guess by now you have found:
sqlcmd -Lc > c:\serverlist.txt
Alternatively, you can put your :serverlist in a script file and use the sqlcmd switches
-i (input file) and -o (output file)
Regards, Michael
December 20, 2007 at 11:17 am
Michael
Thanks for that. I had not got it working as I have been way too busy on a couple of projects.
I will get back to the proj where I was trying to capture the server data into a file soon after new year.
Happy Holidays
Regards JOHN.
September 17, 2013 at 10:20 am
Using Powershell is simple, the syntax is sqlcmd -Lc | Out-File c:\serverlist.txt
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply