How to read the value of "set rowcount int_value" after setting it ?

  • I want in a log function to be able to read the set rowcount nnn variable.

    Has anyone an idea how to read this setting ?

    Thank you !

  • Surely there is a better solution. But the following should work if rowcounts are always less than the number of rows in the sysobjects table (otherwise, consider using another table).

    declare @rowcount int

    declare @count int

    select @count = count(*) from sysobjects

    select @rowcount = 0 from sysobjects

    select @rowcount = @@ROWCOUNT

    if @rowcount = @count

          select @rowcount = 0

    select @rowcount

  • Thank you !

    I'm concerned only about the speed with this solution , I hope the rowcount should be never bigger than the sysobjects table   I will make some speed tests today on my database to see the results and will keep you informed.

     

     

     

  •  

    you can get that value by running DBCC USEROPTIONS

    set rowcount 50

    DBCC USEROPTIONS

    textsize64512
    rowcount50
    languageus_english
    dateformatmdy
    datefirst7
    quoted_identifierSET
    arithabortSET
    ansi_null_dflt_onSET
    ansi_defaultsSET
    ansi_warningsSET
    ansi_paddingSET
    ansi_nullsSET
    concat_null_yields_nullSET

    ISN'T SET ROWCOUNT @VAR a per connection property, and not a global property set at the server?

    so the rowcount would always be 0 (shows all) unless you explicitly set it to some value during your connection?

    also, my sysobjects table has just 5200 or so objects in it, but i have plenty of tables with more than 5200 rows, so i don't think that example would be a goood yardstick to try and find the rowcount variable if it has been set.

    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!

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

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