rebuild index using enterprise manager

  • hi,

    I am a sql server newbie. I have a question.How do you rebuild indexes (all indexes) on a database using enterprise manager? I would like to run this as a job.

    thanks,

    Pn123

  • Hi,

     

    From query analyser you can do this:

    execute sp_msforeachtable 'dbcc dbreindex( [?] )'

    You can schedule this as a job by entering this as the query in the job-step.

     

    Or you can achive the same result by creating a maintenance plan(Management | Maintenance Plans) that does Reorganise data and index pages.

     

    On completing the maintenance plan wizard, jobs which schedule this are created.

     

    HTH

      Regards

      David

     

Viewing 2 posts - 1 through 1 (of 1 total)

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