DBCC DBREINDEX not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jon_brookins@yahoo.com

    DBCC DBREINDEX not working

    I have a stored proc that identifies indexes that need to be
    defragmented ( LogicalFragment ation > 20% ) using DBCC SHOWCONTIG.
    This works fine and shows me all of the candidate indexes to be
    defragged. I am using DBCC DBREINDEX to rebuild the indexes. What I
    noticed yesterday is that it seems that DBREINDEX is not actually doing
    anything. I would check the target indexes, run DBREINDEX, then check
    again. The same list of indexes came up unchanged.

    What is strange is although I am not specifying "WITH NO_INFOMSGS" this
    is the only output from the DBREINDEX:
    "DBCC execution completed. If DBCC printed error messages, contact your
    system administrator."

    According to BOL DBREINDEX should return a result set if "NO_INFOMSG S"
    is not specified, but if "NO_INFOMSG S" is supplied the prior message is
    what is returned. This doesn't seem to be working correctly, or if it
    is, I have no idea where any error messages are being returned.

    Anyone have any ideas?

  • Razvan Socol

    #2
    Re: DBCC DBREINDEX not working

    In this case, the documentation from Books Online is incorrect. The
    documentation has been corrected in SQL Server 2005, where it says:

    Result Sets

    Whether any one of the options, except NO_INFOMSGS, is specified
    (the table name must be specified), DBCC DBREINDEX returns:

    DBCC execution completed. If DBCC printed error messages,
    contact your system administrator.

    Razvan

    Comment

    • jon_brookins@yahoo.com

      #3
      Re: DBCC DBREINDEX not working

      Nice documentation.

      Thanks for the heads-up, Razvan.

      Comment

      Working...