In Windows 10, it seems that all RAISERROR WITH NOWAIT
messages called from sqlcmd are now hidden in the command prompt until the batch is complete:
> sqlcmd -Q "raiserror('Test message', 10, 1) with nowait; waitfor delay '00:00:05'" -b -r1
(no output to console until waitfor
is finished)
Compare this to the same command run from Windows 2008 R2:
> sqlcmd -Q "raiserror('Test message', 10, 1) with nowait; waitfor delay '00:00:05'" -b -r1
Test message
In the above example, you can see the message even though the batch hasn't completed.
Is there a configuration setting in Windows 10 that will bring back this functionality? I have legacy batch files that depend on WITH NOWAIT
to show progression.
This occurs because sqlcmd11 (not sure about higher) does not honor RAISERROR WITH NOWAIT. It does not seem to have anything to do with the underlying OS.
Here's a link to a stackoverflow post with some possible work-arounds.