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).
sp_helpconstraint [@objname =] 'table'
[,[@nomsg =] 'no_message']
0 (success) or 1 (failure)
None
Executing sp_help table reports all information about the specified table. To see only the constraint information, use sp_helpconstraint.
Execute permissions default to the public role.
This example shows all constraints for the authors table.
USE pubs
EXEC sp_helpconstraint authors
ALTER TABLE | sp_help |
CREATE TABLE | System Stored Procedures |