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

    textsize 64512
    rowcount 50
    language us_english
    dateformat mdy
    datefirst 7
    quoted_identifier SET
    arithabort SET
    ansi_null_dflt_on SET
    ansi_defaults SET
    ansi_warnings SET
    ansi_padding SET
    ansi_nulls SET
    concat_null_yields_null SET

    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