Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does Properties work?
Message
 
 
À
04/12/2006 09:15:21
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00838308
Message ID:
01174581
Vues:
19
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform