Thursday, March 22, 2012

DBCC SHOWCONTIG

How can I see the SHOWCONTIG on all my tables in my database. Is there quick
way?
search online for ms_foreachtable.
TheSQLGuru
President
Indicium Resources, Inc.
<msnews.microsoft.com> wrote in message
news:uu1nIWcsHHA.3556@.TK2MSFTNGP05.phx.gbl...
> How can I see the SHOWCONTIG on all my tables in my database. Is there
> quick way?
>
|||Just do a 'dbcc showcontig' with no parameters and it will process all
tables (SQL 2000 onwards). Add WITH ALL_INDEXES to pick up all the
non-clustered indexes too, and WITH TABLERESULTS for easier to correlate
output. Look in Example E I put in BOL for DBCC SHOWCONTIG for a script that
processes all tables.
In SQL 2005, checkout the new DMV, sys.dm_db_index_physical_stats, which has
similar options and can be set to run on all databases.
Thanks
Paul Randal
Principal Lead Program Manager
Microsoft SQL Server Core Storage Engine,
http://blogs.msdn.com/sqlserverstorageengine/default.aspx
<msnews.microsoft.com> wrote in message
news:uu1nIWcsHHA.3556@.TK2MSFTNGP05.phx.gbl...
> How can I see the SHOWCONTIG on all my tables in my database. Is there
> quick way?
>

No comments:

Post a Comment