SQL Server Trigger for recursive delete on a cascade
问题 I have a table which contains a tree like structure It takes the form of: -nodeID,fkID,parentNode (parentNode is NULL if it is the root and the nodeID of its parent if it is a child) (fkID is NULL if it is not the root) the fkID is a FK which when deleted in another table cascades its delete to this table. This cascading delete only however references the root node. There is another constraint put on the database in which a root node cannot be deleted unless its children are deleted first.