Reputation: 15455
I have a sqlcmd that I'm outputting results to a text file. The first cmd is a USE mydatabase command and it logs that info in the output file that it "Changed database context to mydatabase"
How do I turn that off in the log?
Upvotes: 3
Views: 896
Reputation: 58441
Perhaps related to your problem is the following link
using SP_SEND_DBMAIL, I just needed to use the parameter "@execute_query_database=XXXXX";
or pass the -m flag as mentioned here
check SQLCMDERRORLEVEL and the -m flag passed to sqlcmd.
C:\>sqlcmd -Q "use master" -E
Changed database context to 'master'.
C:\>sqlcmd -Q "use master" -E -m 1
C:\>
Upvotes: 3