December 20, 2005 at 5:56 pm
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 !
December 21, 2005 at 6:35 am
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
December 21, 2005 at 10:58 am
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.
December 22, 2005 at 1:33 pm
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
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply