Home > Archive > Microsoft SQL Server forum > September 2005 > Can I force printing?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Can I force printing?
jim_geissman@countrywide.com

2005-08-31, 8:24 pm

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

Dan Guzman

2005-09-01, 3:23 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

< jim_geissman@country
wide.com> wrote in message
news:1125531618.828313.53510@z14g2000cwz.googlegroups.com...
>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
>



jim_geissman@countrywide.com

2005-09-02, 8:23 pm

Thanks, Dan.

Jim Geissman

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com