Displaying Information About Constraints

To list the constraints used in a table, use the sp_helpconstraint system stored procedure. For example, to see a report about the titles table:

sp_helpconstraint titles

Object Name
-----------
titles   
 
constraint_type
constraint_name
---------------
---------------
PRIMARY KEY (clustered)
UPKCL_titleidind
FOREIGN KEY
FK__titles__pub_id__0E4E2B2E


DEFAULT on column type
DF__titles__type__0D5A06F5
DEFAULT on column pubdate
DF__titles__pubdate__0F424F67


constraint_keys
---------------
title_id
pub_id

REFERENCES pubs.dbo.publishers (pub_id)       
('UNDECIDED')
(getdate())

Table is referenced by
---------------------------------------------------- 
pubs.dbo.titleauthor: FK__titleauth__title__14070484 
pubs.dbo.sales: FK__sales__title_id__1BA8264C        
pubs.dbo.roysched: FK__roysched__title___1E8492F7