Is there a stored procedure to list all tables and their size, and / or
number of rows
Is there a stored procedure to list all indexes and their sizeCheck this link:
How do I get a list of SQL Server tables and their row counts?
http://sqlserver2000.databases.aspfaq.com/how-do-i-get-a-list-of-sql-server-tables-and-their-row-counts.html
"Zack" wrote:
> Is there a stored procedure to list all tables and their size, and / or
> number of rows
> Is there a stored procedure to list all indexes and their size
>
>|||The final solution in that article uses DBCC UPDATEUSAGE(0). This is fine,
but here are two further suggestions you might want to take into
consideration:
a) DBCC UPDATEUSAGE(0) updates sysindexes for all indexes on all tables in a
database. This can take a long time on a large production database & lead to
major performance degradation if used during peak processing periods. Just
make sure you schedule this for periods of low activity or keep a close eye
on the server whilst its running if users are using the database at the
time.
b) DBCC UPDATEUSAGE(0) alone doesn't update the rowcount for each table -
you have to add the additional "with count_rows" option if you want an
update of how many rows are in the table. Keep in mind that this figure will
always be slightly out of date on a busy server thoug. I generally don't use
it, but it's worth knowing all the same
Regards,
Greg Linwood
SQL Server MVP
http://blogs.sqlserver.org.au/blogs/greg_linwood
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA"
<EdgardoValdezMCTSMCITPMCSDMCDBA@.discussions.microsoft.com> wrote in message
news:57C92A87-D9DE-46AE-A45C-39D1DF9A272E@.microsoft.com...
> Check this link:
> How do I get a list of SQL Server tables and their row counts?
> http://sqlserver2000.databases.aspfaq.com/how-do-i-get-a-list-of-sql-server-tables-and-their-row-counts.html
> "Zack" wrote:
>> Is there a stored procedure to list all tables and their size, and / or
>> number of rows
>> Is there a stored procedure to list all indexes and their size
>>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment