Query to find all FK constraints and their delete rules (SQL Server) -
in sql server 2005, can issue sql query list fk constraints on tables within db, , show delete rule? (ie nothing, cascade, set null, or set default)
the output i'm looking akin to:
fk_name on_delete ================================== fk_lineitem_statement cascade fk_accountrep_client nothing
you can try this:
select name, delete_referential_action_desc sys.foreign_keys
Comments
Post a Comment