February 23, 2012 at 2:37 am
I have been executing multiple SQL scripts using a batch file with SQLCMD and outputting the results to a text file.
What I have noticed is that the output differs between using the -o and -r parameters. Also if I run the scripts manually in SSMS the output is different again.
For example;
sqlcmd -E -s ServerName -d DBName -i Script1.sql -r > C:\Output\output.txt
sqlcmd -E -s ServerName -d DBName -i Script2.sql -r >> C:\Output\output.txt
as opposed to
sqlcmd -E -s ServerName -d DBName -i Script1.sql -o > C:\Output\output.txt
sqlcmd -E -s ServerName -d DBName -i Script2.sql -o >> C:\Output\output.txt.
Has anyone seen this before?
Thanks
Steve
February 23, 2012 at 5:07 am
What is the difference in your outputs?
February 23, 2012 at 6:10 am
The -o / -r switched gave different levels of detail. The output from running manually in SSMS was different again.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply