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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -