updating statistics on specific indices script

  • Hi - I'm looking for a quick script that someone has already written to update statistics (not to rebuild or re-organise) on specific indices in specific databases - I guess loop though a table comprising of a list of databases and the indices.

    I know Ola has one but I'm not look for something that is that complicated. If I cannot find one I'm going to have to write one myself - I want to try and avoid re-inventing the wheel as tomorrow I have to do this work and it's about 7K plus indices in about 10+ databases.

    If anyone could help I'd appreciate it - thanks

  • StillaLearner (8/8/2015)


    Hi - I'm looking for a quick script that someone has already written to update statistics (not to rebuild or re-organise) on specific indices in specific databases - I guess loop though a table comprising of a list of databases and the indices.

    I know Ola has one but I'm not look for something that is that complicated. If I cannot find one I'm going to have to write one myself - I want to try and avoid re-inventing the wheel as tomorrow I have to do this work and it's about 7K plus indices in about 10+ databases.

    If anyone could help I'd appreciate it - thanks

    I think the Ola Hallengren's SQL Server Index and Statistics Maintenance is the easiest solution here, as you said, there is no need for reinventing this.

    😎

    In order to only update the statistics set the values for FragmentationLow, FragmentationMedium and FragmentationHigh to NULL and UpdateStatistics to INDEX.

  • Check out Minion Reindex[/url]. That will do what you're trying to do and a whole lot more.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

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

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