Results 1 to 7 of 7

Thread: Database Maintenance Plan - Index Rebuild

  1. #1
    Join Date
    May 2005
    Posts
    111

    Database Maintenance Plan - Index Rebuild

    Does anyone know the actual t-sql script that runs in the indexing part of a maintenance plan?

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

  3. #3
    Join Date
    May 2005
    Posts
    111
    BOL??? what is BOL? and I tried running DBCC DBREINDEX prior to posting my original question, however it appears as if you can only run said command against a specific table...not the entire database. I believe the job within the maintenance plan runs against the entire database.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    BOL is sql books online, and you can rebuild index on the db with this one:

    sp_MSforeachtable 'dbcc dbreindex("?")'

  5. #5
    Join Date
    Jun 2005
    Posts
    4

    does it really do it

    How can we see that it works. any suggestions
    I couldnt find this sp_msforeachtable
    on my BOL

  6. #6
    Join Date
    Sep 2002
    Posts
    5,938
    You can check job history, and sp_MSforeachtable is undocumented.

  7. #7
    Join Date
    Jun 2005
    Posts
    4
    thnks alot
    You should write articles on undocumented processes


Posting Permissions

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