all groups > sql server (alternate) > august 2005 >
You're in the

sql server (alternate)

group:

Can I force printing?


Can I force printing? jim_geissman NO[at]SPAM countrywide.com
8/31/2005 4:40:18 PM
sql server (alternate): I have a script or SP that takes a very long time to perform
multiple tasks, and after each one there is a PRINT statement
that shows the time and what was just accomplished, to help me
monitor what's happening and estimate how long it will take.
In a script, I can put a GO after each PRINT to cause the output
to appear immediately, but that's not possible inside an SP.
Instead, it seems the output goes to a buffer, and the buffer
is only output when a PRINT causes the buffer to become full.
Sometimes there is a long delay before the buffer fills. Is
there a way other than GO to cause immediate printing? (I
guess I could just use longer messages, and fill up the
buffer with every one, but that's not very elegant.)

Thanks,
Jim G
Countrywide Home Loans
Re: Can I force printing? Dan Guzman
9/1/2005 12:00:00 AM
You can use RAISERROR...WITH NOWAIT to cause messages to avoid buffering.
Messages will be displayed immediately when using a tool like Query
Analyzer:

RAISERROR ('my message', 0, 1) WITH NOWAIT

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

Re: Can I force printing? jim_geissman NO[at]SPAM countrywide.com
9/2/2005 3:31:07 PM
Thanks, Dan.

Jim Geissman
AddThis Social Bookmark Button