views:

240

answers:

1

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
This seems like the duplicate http://stackoverflow.com/questions/306945/how-do-i-flush-the-print-buffer-in-tsql
astander
Agreed. Same Question, same answer!
Martin Smith
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