SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

The Ultimate Index Lister (Pivoted)

By Jesse Roberge,

By Jesse Roberge - YeshuaAgapao@Yahoo.com
Update - Fixed existance check for drop

Lists details for all indexes on one or more tables / schemas, including row count and size.
If you want data types and other column information and one row per index instead of one row per member column,
then use Util_ListIndexes_Columns instead.

Update 2009-01-14:
Added IndexDepth and FillFactor output columns
Added @Delimiter parameter for the column listing output (Defaults to ,) for accomodating export to delimited files.
Removed duplicate output of 'is_unique'

Required Input Parameters

Optional Input Parameters
@SchemaName sysname='' Filters to a single schema. Can use LIKE wildcards. All schemas if blank. Accepts LIKE Wildcards.
@TableName sysname='' Filters to a single table. Can use LIKE wildcards. All tables if blank. Accepts LIKE Wildcards.
@Delimiter VarChar(1)=',' Delimiter for the horizontal delimited seek and include column listings. For accomdating csv export.

EXECUTE Util_ListIndexes 'dbo', 'Cart'

Licensed under the L-GPL - a weak copyleft license - you are permitted to use this as a component of a proprietary database and call this from proprietary software.
Copyleft lets you do anything you want except plagarize, conceal the source, proprietarize modifications, or prohibit copying & re-distribution of this script/proc.

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
GNU Lesser General Public License for more details.

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

Total article views: 2436 | Views in the last 30 days: 1
Related Articles

comma delimited name column

comma delimited name column


SQL – Split delimited columns using XML Or UDF function

The requirement is to convert the delimited column into rows Input data and required output details...


Executing cmd file with isqlw command imbedded, want to change output file delimiter

Analyzer configured with TAB output delimiter want to dynamically change


T-SQL code to group data into comma delimited column

T-SQL code to group data into comma delimited column