Tuesday, March 20, 2012

can't see print messages during the running a of stored procedure

I have a stored procedure running from Query Analyzer that runs for a long
time and would like to have status messages print out during the procedure.
They all seem to come when the procedure is complete - is there any way to
have them print while it is running. I 've actually tried having the main
SP call a smaller SP with prints, but they don't come out till the end as
well.
Help to a new Transact SQL writer,
Thanks
TW
TW,
I don't know how to do just what you want, but you could try pumping your
messages into a trace table. Then you could query that table while the
long-running stored procedure continues. Transaction isolation levels would
affect how this works for you.
Russell Fields
"Weave" <tweaver60@.suscom.net> wrote in message
news:10apu6dm256v76@.corp.supernews.com...
> I have a stored procedure running from Query Analyzer that runs for a long
> time and would like to have status messages print out during the
procedure.
> They all seem to come when the procedure is complete - is there any way to
> have them print while it is running. I 've actually tried having the main
> SP call a smaller SP with prints, but they don't come out till the end as
> well.
> Help to a new Transact SQL writer,
> Thanks
> TW
>
|||You could use RAISERROR and the NOWAIT option instead of PRINT.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Weave" <tweaver60@.suscom.net> wrote in message news:10apu6dm256v76@.corp.supernews.com...
> I have a stored procedure running from Query Analyzer that runs for a long
> time and would like to have status messages print out during the procedure.
> They all seem to come when the procedure is complete - is there any way to
> have them print while it is running. I 've actually tried having the main
> SP call a smaller SP with prints, but they don't come out till the end as
> well.
> Help to a new Transact SQL writer,
> Thanks
> TW
>

No comments:

Post a Comment