When I use PRINT statements to debug and monitor long running queries in SQL Server Management Studio, I notice that the output does not appear in the Messages tab right away. Is there a way to flush output to the message tab, or to set up the environment so that it doesn't buffer messages?
+1
A:
Use RAISERROR with NOWAIT instead of PRINT http://www.mssqltips.com/tip.asp?tip=1660
Martin Smith
2010-04-21 17:18:09
This seems like the duplicate http://stackoverflow.com/questions/306945/how-do-i-flush-the-print-buffer-in-tsql
astander
2010-04-21 17:58:47
Agreed. Same Question, same answer!
Martin Smith
2010-04-21 19:27:50
Works like a charm, thanks. Not sure why couldn't find 306945 when I first searched for this, although I notice that the first 50 relevant results in a search for "SQL Print Flush" doesn't find this reference. May I ask how you found the original post?
Paul Keister
2010-04-29 16:34:33