Identify duplicate indexes

  • Hi!

    I hope you can help me out on this one.

    We have identified several indexes on the same columns on several of our tables.

    How should i write a script that lists and/or drops each duplicate index sorted by the index column( or combination of columns)?

    The idea is to create a script to run on production servers at customer sites.

    The way i picture it in my head, the script could automatically drop the first ( of each index combination found) duplicate.

    Is it possible/advisable to create such a script?

    I have played around with some system views, but haven't been able to write the wanted queries yet.

    Please help.

  • there's a large number of scripts in the contribution section for this;

    I've used "The Ultimate Duplicate Index Finder" myself;

    take a look here:

    http://www.sqlservercentral.com/search/?q=duplicate+indexes&t=s

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Hi,

    Thanks for the quick reply!

    And thank you once again for your politely telling me to use the search functions of this site:-)

    I think I most likely will find what I'm looking for in one of these scripts.

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

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