SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Find Duplicate Indexes

By Jeff Weisbecker, 2003/12/04

Total article views: 573 | Views in the last 30 days: 101

There are plenty of scripts out there that find duplicate indexes, but they all seem to use cursors.  I didn't want to use a cursor so I ended up creating a few that could handle the duplicates and decided to share this one. 

This will return the table name and the names of the two identical indexes.  If you would like to return indexes with a different number of columns, but the same sequence of columns then comment out the last condition in the SQL statement.  For example, if you would like to return Index #1 as a duplicate of Index #2.

Index #1
  Column 2
  Column 3

Index #2
  Column 2
  Column 3
  Column 4

By Jeff Weisbecker, 2003/12/04

Total article views: 573 | Views in the last 30 days: 101
Your response
 
 
Related tags
 
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com