sp_helpindex

Transact-SQL Reference

Transact-SQL Reference

sp_helpindex

Reports information about the indexes on a table or view.

Syntax

sp_helpindex [ @objname = ] 'name'

Arguments

[@objname =] 'name'

Is the name of a table or view in the current database. name is nvarchar(776), with no default.

Return Code Values

0 (success) or 1 (failure)

Result Sets
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.

Remarks

If indexes have been set with the NORECOMPUTE option of UPDATE STATISTICS, that information is shown in the result set of sp_helpindex.

Permissions

Execute permissions default to the public role.

Examples

This example reports on the types of indexes on the sysobjects table.

sp_helpindex sysobjects

See Also

CREATE INDEX

DROP INDEX

DROP STATISTICS

sp_help

sp_statistics

System Stored Procedures

UPDATE STATISTICS