0

Is there a SQL query that can tell whether a given index/constraint for a table is set to cascade on delete?

FYI, the database I'm using is SQL Azure

Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133
  • 1
    If your database supports `INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS` it has a `DELETE_RULE` column – Laurence Oct 09 '14 at 19:24
  • 1
    For SQL Azure look at `sys.foreign_keys`. It has a `delete_referential_action` column. http://msdn.microsoft.com/en-us/library/ms189807.aspx. Not sure if it supports `INFORMATION_SCHEMA`, although the server versions of SQL Server do. – Laurence Oct 09 '14 at 19:31

0 Answers0