Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does Properties work?
Message
 
 
To
04/12/2006 09:15:21
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00838308
Message ID:
01174581
Views:
17
You can update the row counts for current DB by running
DBCC UPDATEUSAGE(0) WITH COUNT_ROWS
>thought I was going crazy!
>
>>
>>There're two ways to get total records count in SQL Server table:
>>1. SELECT COUNT(*) FROM mytable
>>Produces correct count but may take long on tables with a lot of records.
>>
>>2. SELECT rowcnt FROM sysindexes WHERE id=OBJECT_ID('dbo.mytable') and indid < 2
>>Fast but result isn't relaible because it's based on data stored in sysindexes tables which may or may not be current.
>>
>>Most likely SQL Server uses the second method because it's much faster on big tables.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform