1

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

(immediate output)

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.

Ivan Starostin
  • 8,798
  • 5
  • 21
  • 39
8kb
  • 10,956
  • 7
  • 38
  • 50
  • 2
    Please, please please learn how to copy and paste text from a command window... Mobile users and those who are vision impaired are saying really impolite things about you right now. Not a single one of your images was necessary to demonstrate the issue you're having. Images should be a last resort when there is no other way to demonstrate the issue, and command windows display plain text that is extremely easy to copy and paste, especially with the improvements made in Windows 10. – Ken White Dec 22 '16 at 01:23
  • Images were posted to demonstrate the behavior occurring which would not verifiable with copy and pasting text from the command window. – 8kb Dec 22 '16 at 04:39
  • Tried your example statement on Win 2008 R2 + MSSQL 2012, can't reproduce. The observed behaviour is consistent with what you see on Windows 10. – Roger Wolf Dec 22 '16 at 13:49

1 Answers1

1

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.

Community
  • 1
  • 1
randomsolutions
  • 2,075
  • 1
  • 19
  • 22