JR2003
asked on
Identifying FKs with On Delete Cascade from a query.
I would like to identify whether a foreign key has the delete cascade option set by querying SQL Server system tables.
I need a query which shows the FKs on a database and whenther the delete cascade option set.
I need a query which shows the FKs on a database and whenther the delete cascade option set.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
select so.name,
objectproperty(so.id, 'CnstIsDeleteCascade') AS DeleteCascade
from sysforeignkeys fk
inner join sysobjects so
on fk.constid = so.id