1
Vote

PK, FK, and Unique keys

description

Need to use the following:
--where commentary is the table name
EXEC sp_pkeys @table_name="commentary"; -- PKs
EXEC sp_fkeys @pktable_name="commentary"; -- FKs
EXEC sp_statistics @table_name='commentary', @is_unique=Y; -- Unique constraints
 
Need to check cascades as well.
 
To implement them in the object model.
 
Need an enum set for the table fields to implement this, i.e. CommentaryFields PrimaryKey = commentary.id; blah, blah

comments