Reports information about the indexes on a table or view.
sp_helpindex [ @objname = ] 'name'
[@objname =] 'name'
Is the name of a table or view in the current database. name is nvarchar(776), with no default.
0 (success) or 1 (failure)
Column name | Data type | Description |
---|---|---|
index_name | sysname | Index name. |
index_description | varchar(210) | Index description. |
index_keys | nvarchar(2078) | Table or view column(s) upon which the index is built. |
A descending indexed column will be listed in the result set with a minus sign (-) following its name; an ascending indexed column, the default, will be listed by its name alone.
If indexes have been set with the NORECOMPUTE option of UPDATE STATISTICS, that information is shown in the result set of sp_helpindex.
Execute permissions default to the public role.
This example reports on the types of indexes on the sysobjects table.
sp_helpindex sysobjects