DBCC SHOWCONTIG BOL Example

  • In the Jan 2004 edition of SQL 200O BOL Example E for DBCC ShowContig is a script that works through the tables of the database logging the results of ShowContig and if fragmentation exceeds a certain amount it runs a DBCC INDEXDEFRAG.

    Firstly the script is inefficient

    Secondly I think that there is an error in it.

    WHERE LogicalFrag >= @maxfrag appears to be an error, surely it should be ScanDensity?

  • I'm sure that I've read before that the example of the in BOL has a bug, if your change fixes it then good for you.

  • That's not the first and definitely not the last ... I've seen 'foo bar' in BOL provided code since v6.0 !

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • Hi, where can I find this BOL. The script is just what I want, I do not mind it has a bug or two.

  • Try searching for LogicalFrag in BOL, it responds with DBCC SHOWCONTIG. I believe it's example "E".

    RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."

  • It might not be in the version of BOL that comes with the SQL2000 CD. An updated to BOL is available as a free download from Microsoft.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply