This is for MS SQL 2005 server. I have a query that deletes all lost records in a table. However, there are self-regulating FKs in this table. I also need to remove them, but it is not clear how to do this. The current script deletes all records that do not appear as FKs in other tables, but I did not take into account self-regulating FKs in my table. the table is simple:
PK, FK, DAta 1, NULL, jibberjab 2, 1, jibberjab2 3, 1, skdfasfa
source share