I am trying to delete data from a table which is being referenced by a lot
of tables by Foreign Keys. There are 2 tables in particular that do not
have an index on the Foreign Key field referencing the table that I am
deleting from.
I am certain that there are no rows in this dependant table referencing the
rows that I want to delete.
Is it possible to somehow perform the delete without checking the Foreign
Key? Since this is a production database - I don't want to drop the FK and
then redefine it later because I will experience blocking while the create
of the Foreign Key is running.
Any help would be appreciated.
ThanksYou can disable the FK, delete and then enable it. But that leave the FK non
-trusted, unless you
enable it with the CHECK option, but that leaves you with SQL Server checkin
g the data when enabling
it (basically same as dropping and creating). Same old story, can't eat the
cake and have it. :-)
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"TJT" <TJT@.nospam.com> wrote in message news:O9VnXOyiGHA.1552@.TK2MSFTNGP03.phx.gbl...seagreen">
>I am trying to delete data from a table which is being referenced by a lot
> of tables by Foreign Keys. There are 2 tables in particular that do not
> have an index on the Foreign Key field referencing the table that I am
> deleting from.
> I am certain that there are no rows in this dependant table referencing th
e
> rows that I want to delete.
> Is it possible to somehow perform the delete without checking the Foreign
> Key? Since this is a production database - I don't want to drop the FK an
d
> then redefine it later because I will experience blocking while the create
> of the Foreign Key is running.
> Any help would be appreciated.
> Thanks
>
订阅:
博文评论 (Atom)
没有评论:
发表评论