sp_helpconstraint System Stored Procedure

Returns a list of all constraint types, their user-defined or system-supplied name, the columns on which they have been defined, and the expression that defines the constraint (for DEFAULT and CHECK constraints only).

Syntax

sp_helpconstraint table_name

where

table_name
Specifies the table about which you want constraint information.

Remarks

Executing sp_help table_name reports all information about the specified table. To see only the constraint information, use sp_helpconstraint.

Permission

Execute permission defaults to the public group.

Tables Used

syscolumns, syscomments, sysconstraints, sysindexes, sysobjects, sysreferences

Example

This example shows all constraints for the employee table.

sp_helpconstraint employee

See Also

ALTER TABLE sp_help
CREATE TABLE