tsql - Sql server - recursive delete -


i'm trying delete user's data , it's related data located in different tables. tables have foreign keys without cascade delete.

i investigated options:

  1. enable cascade delete on fk, delete , remove cascade delete.
  2. delete bottom up, loop leaves delete , repeat operation till root.

are there more smart option or other techniques?

i'm using microsoft sql server 2012 (sp1)

oracle solution:

how generate delete statements in pl/sql, based on tables fk relations?

sql server solution:

generate delete statement foreign key relationships in sql 2008?

hope helps


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -