Home Forums SQL Server 2005 T-SQL (SS2K5) Cursor.. cmds don’t seem to update until everything has finished RE: Cursor.. cmds don’t seem to update until everything has finished

  • inside a cursor, that's normal; what you want to do instead of print is raise a low level error inside via RAISERROR the cursor so you can see things as it happens.

    errors with NOWAIT are immediately visible in the results pane.

    example:

    --print error immediately in batch

    declare @i int,

    @err varchar(100)

    --set @i=1

    while 0=0

    begin

    SET @err = 'Progress So Far: Step ' + convert(varchar(30),ISNULL(@i,1)) + ' completed.'

    raiserror (@err,0,1) with nowait

    waitfor delay '00:00:02'

    set @i=ISNULL(@i,1) + 1

    end

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!