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

The Ultimate Duplicate Index Finder

By Jesse Roberge, 2008/10/17

Total article views: 69 | Views in the last 30 days: 69

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
Util_DupeIndexes
By Jesse Roberge - YeshuaAgapao@Yahoo.com

Searches database-wide for multiple indexes in the same table which has the same column as the first key. Optionally limits to LIKE wildcard patterns of table and schema names.
Uses XML PATH ('') to pivot the column names.

Required Input Parameters:
none

Optional Input Parameters:
@SchemaName sysname='' Filters schemas. Can use LIKE wildcards. All schemas if blank. Accepts LIKE Wildcards.
@TableName sysname='' Filters tables. Can use LIKE wildcards. All tables if blank. Accepts LIKE Wildcards.

Usage:
EXECUTE Util_DupeIndexes 'dbo', 'hr%'

Copyright:
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

see <http://www.fsf.org/licensing/licenses/lgpl.html> for the license text.

*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

By Jesse Roberge, 2008/10/17

Total article views: 69 | Views in the last 30 days: 69
Your response
 
 
Related tags

Administration     pivot    
Crosstab     SQL 2005    
Duplicate Indexes     SQL Server 2005    
FOR XML PATH     sys.dm_db_partition_stats    
Index Management     TSQL    
Indexes     T-SQL    
Indexing     T-SQL Aids    
List Indexes     Tuning    
Maintenance     Utility    
Maintenance and Management    
 
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