Using Print

  • I have a question about using print. I put some print statement in an stored proc so I could monitor the progress of a long running email. If NoCount is Off everything is fine. The problem is when I turn "NoCount On". I don't get any results until the SP finishes. Is there any way to flush the buffer back so that incremental results can be viewed?

  • I prefer to use a logging table instead. Simply insert the records into the logging table and then when you want to check the status select from the log table using the NOLOCK hint. Works pretty well for me!




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

  • Why you want to view the progress if you decided to set NOCOUNT ON?



    Regards,
    kokyan

  • I figured this out. If I turn No Count off and then back on again. It flushes the buffer.

  • use select instead of print

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply