Results 1 to 2 of 2

Thread: How could load results of [DBCC showcontig (@TableName) with tableResults] to a table

  1. #1
    Join Date
    Mar 2003
    Posts
    383

    How could load results of [DBCC showcontig (@TableName) with tableResults] to a table

    Hi:

    how could I load "DBCC showcontig (@TableName) with tableResults" to a table?
    I created a table and let insert to it via above "DBCC...."
    but problem is the results with "DBCC execution completed. If DBCC printed error messages, contact your system administrator.", or how could I mute this output line for each table ?
    thanks
    David
    --=========================================
    DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    ObjectName ObjectId IndexName IndexId Level Pages Rows MinimumRecordSize MaximumRecordSize AverageRecordSize ForwardedRecords Extents ExtentSwitches AverageFreeBytes AveragePageDensity ScanDensity BestCount ActualCount LogicalFragmentation ExtentFragmentation
    -------------------------------------------------------------------------------------------------------------------------------- ----------- -------------------------------------------------------------------------------------------------------------------------------- ----------- ----------- -------------------- -------------------- ----------------- ----------------- ---------------------- -------------------- -------------------- -------------------- ---------------------- ---------------------- ---------------------- -------------------- -------------------- ---------------------- ----------------------
    sysproxylogin 37575172 clust 1 0 0 0 0 0 0 0 0 0 0 0 100 0 0 0 0

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    You have to build a table before you run dbcc, like

    CREATE TABLE #fraglist
    (
    ObjectName CHAR (255),
    ObjectId INT,
    IndexName CHAR (255),
    IndexId INT,
    Lvl INT,
    CountPages INT,
    CountRows INT,
    MinRecSize INT,
    MaxRecSize INT,
    AvgRecSize INT,
    ForRecCount INT,
    Extents INT,
    ExtentSwitches INT,
    AvgFreeBytes INT,
    AvgPageDensity INT,
    ScanDensity DECIMAL,
    BestCount INT,
    ActualCount INT,
    LogicalFrag DECIMAL,
    ExtentFrag DECIMAL
    )

    Then you can run

    INSERT INTO #fraglist
    EXEC ('DBCC SHOWCONTIG (<objectid>)
    WITH FAST, TABLERESULTS, ALL_INDEXES, NO_INFOMSGS')

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •