I'm trying to determine what tables in a database are involved in a cascade
update constraint. I've searched the net but found nothing. I know I can use
sp_help to get this info. or sp_helpconstraint, but I don't know where these
procedures are get their information. I would like to create a script that
would go through the DB and return what tables have this sort of constraint
on them. Can anyone advise or point me in the right direction.
Thanks.
WillUsing the information_schema tables, I wrote the following.
select t.table_name, r.constraint_name
from information_schema.referential_constraints r
inner join information_schema.table_constraints t on r.constraint_name =t.constraint_name
and delete_rule = 'cascade'
Does this help?
"Will" <kixman@.hotmail.com> wrote in message
news:u58GXD5wEHA.1512@.TK2MSFTNGP12.phx.gbl...
> I'm trying to determine what tables in a database are involved in a
cascade
> update constraint. I've searched the net but found nothing. I know I can
use
> sp_help to get this info. or sp_helpconstraint, but I don't know where
these
> procedures are get their information. I would like to create a script that
> would go through the DB and return what tables have this sort of
constraint
> on them. Can anyone advise or point me in the right direction.
> Thanks.
> Will
>
Wednesday, March 7, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment