• mig28mx - Friday, September 1, 2017 8:46 AM

    Hi Sue,
    Thank for your reply. Yes you are right. This procedure only runs in the master db. So the, objective is not covered with this script.
    I will take a look to Ola Hallegeren Index to see if I can implement on my db server.
    From the application point of view (I use Infor's SYTELINE ERP), the recommended procedure is to use dbcc INDEXDEFRAG for each table.

    Thank you.

    Correct since the use statement is no longer applicable after the exec. I think most of the others have a table for databases and table for indexes that would need to be defragemented. You could use temp tables or static tables that you truncate before processing. Most of how it is set up is in the beginning of those other scripts.
    If the  vendor recommends something, it's usually best to follow their recommendations.

    Sue