Request for the script of indexes

  • Friends,

    Could any one help me to get the script which is suitable to below scenario.

    1) It should identify the fragmentation.

    2) If any of the index is less than 30% it has to script out all the indexes which should be like below

    Alter index [index_name] on [Table_name] reorganize

    3) If any of the index is greater than 30% it has to script out the indexes which should be like below.

    Alter index [Index_Name] on [Table_Name] rebuild with online=off

    Thanks,
    I’m nobody but still I’m somebody to someone………….

  • Do a search for Ola Hallengren. He has everything you need.

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • Ignore this post, wrongly located.

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

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