Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Anton Shepelev Newsgroups: comp.databases.ms-sqlserver Subject: Re: `sqlcmd' withholding error messages? Date: Mon, 22 Aug 2022 17:46:22 +0300 Organization: A noiseless patient Spider Lines: 35 Message-ID: <20220822174622.48bf464fa2922e017f8b8714@g{oogle}mail.com> References: <20220811131035.f10b114df6b905668746c2ab@g{oogle}mail.com> <20220822123952.e80b413b6a97e34fb150cf27@g{oogle}mail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: reader01.eternal-september.org; posting-host="27032e634897e836e026c82cd8ed2551"; logging-data="2832554"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1919BFGYnTG2XD+qhzK8Oo11b4Yg6gv464=" Cancel-Lock: sha1:1nokjWj6yCTJW6rqbSG79NOf0p8= X-Newsreader: Sylpheed 3.5.0 (GTK+ 2.24.23; i686-pc-mingw32) Xref: csiph.com comp.databases.ms-sqlserver:2160 I wrote: > Luuk: > > > -r[0 | 1] > > Redirects the error message output to the screen > > (stderr). If you do not specify a parameter or if you > > specify 0, only error messages that have a severity > > level of 11 or higher are redirected. If you specify 1, > > all error message output including PRINT is redirected. > > Has no effect if you use -o. By default, messages are > > sent to stdout. > > Yes. I inovke `sqlcmd' not only with -r 0, but also with > -b: > > -b > Specifies that sqlcmd exits and returns a DOS ERRORLEVEL > value when an error occurs. The value that is returned to > the DOS ERRORLEVEL variable is 1 when the SQL Server error > message has a severity level greater than 10 > > The invocation sqlcmd -r 0 -b should either succeed or > print an error message in stderr. In my case, however, it > failed but did not send anything to stderr. To clarify -- my purpose is to cause `sqlcmd' to terminate with non-zero error code and to send the output to STDERR in on errors of severity 11 or highter, and to continue exeuction and send output to STDOUT otherwise. I believe my invocation is should achieve that end, does it not? -- () ascii ribbon campaign - against html e-mail /\ http://preview.tinyurl.com/qcy6mjc [archived]