Is there a FLUSH command equivalent in SQL 2000?

  • Hi,

    Please look at the following script. The script completes after one minute and displays all output (1,000s of lines).

    I want to 'flush' the video buffer (for want of a better technical description) to the screen so that I can see the 'Test' message at every occurence, or even periodically.

    Can someone please advise of a way to acheive this?

    Thanks,

    Joe

    DECLARE @TerminateAfterMins INT

    DECLARE @CurrentTime DATETIME

    DECLARE @FinishTime DATETIME

    SET @TerminateAfterMins = 1

    SET @FinishTime = DATEADD (mi, @TerminateAfterMins, GETDATE())

    WHILE GETDATE() < @FinishTime

      BEGIN

        PRINT 'Test'

        -- can I force a write to the screen here???

      END

     

  • Use RaisError with a zero error code instead of PRINT.

    Do you really need the loop and the continuous feedback ? Can't you just use WAITFOR ?

     

  • Thanks - that helps a little.

    I also looked at the different effects each of the following has on Query Analyser's output. If you're interested you should play around with these and see for yourself.

    Query / Results in Text.

    Query / Results in Grid.

    Tools / Options / Results / Show results as received.

    Different effects PRINT, SELECT and RAISERROR have under these settings.

    Joe

     

Viewing 3 posts - 1 through 2 (of 2 total)

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