SET ROWCOUNT

  • So I set the rowcount to 1 in a query session.....but now I can't get more than 1 row to return. How can I turn it back off?

    I ran SET ROWCOUNT 1

    and to reverse I tried

    SET ROWCOUNT

    SET ROWCOUNT OFF

    SET ROWCOUNT = OFF

    None of those commands are valid

  • daglugub 60457 (2/27/2013)


    So I set the rowcount to 1 in a query session.....but now I can't get more than 1 row to return. How can I turn it back off?

    I ran SET ROWCOUNT 1

    and to reverse I tried

    SET ROWCOUNT

    SET ROWCOUNT OFF

    SET ROWCOUNT = OFF

    None of those commands are valid

    SET ROWCOUNT 0;

  • thanks, that worked. I dismissed trying that because I want more than zero rows. I need to stop listening to my gut instincts, when it comes to sql, I don't have any

  • daglugub 60457 (2/27/2013)


    thanks, that worked. I dismissed trying that because I want more than zero rows. I need to stop listening to my gut instincts, when it comes to sql, I don't have any

    Press {f1} and search for ROWCOUNT and other such things. It's a whole lot faster than posting to a forum.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff gives good advice...but I will agree that SET ROWCOUNT 0 is not exactly intuitive.

    Hmmm... now is it SET NOCOUNT 0 or SET NOCOUNT OFF? Do you expect consistency? 😛

     

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

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