Sqlcmd disable text

I have sqlcmd that outputs the results to a text file. The first cmd is the USE mydatabase command, and it logs this information in the output file, that "The database context in mydatabase is changed"

How to disable this in the log?

+3
source share
1 answer

Perhaps the following link related to your problem

using SP_SEND_DBMAIL, I just needed to use the parameter "@Execute_query_database = XXXXX";

or pass the -m flag as indicated 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:\>
+3
source

Source: https://habr.com/ru/post/1791489/


All Articles