Generate Delete Statement From Foreign Key Relationships in SQL 2008 ?
Posted
by Element
on Stack Overflow
See other posts from Stack Overflow
or by Element
Published on 2009-01-27T22:20:41Z
Indexed on
2010/04/20
17:13 UTC
Read the original article
Hit count: 129
Is it possible via script/tool to generate a delete statement based on the tables fk relations.
i.e. I have the table: DelMe(ID) and there are 30 tables with fk references to its ID that I need to delete first, is there some tool/script that I can run that will generate the 30 delete statements based on the FK relations for me ?
(btw I know about cascade delete on the relations, I can't use it in this existing db)
I'm using Microsoft SQL Server 2008
© Stack Overflow or respective owner