you can use below query to find the dependeny objects from parent till last child;WITH table_dependenciesAS(SELECT object_name(object_Id) AS table_name,object_Id,1 AS levelfrom sys.objectsWHERE object_name(object_Id)= <yourtablenamehere> union allSELECT object_name(f.referenced_object_Id),f.referenced_object_Id,d.Level + 1FROM sys.foreign_keys fJOIN table_dependencies dON f.parent_object_id = d.object_Id)SELECT table_nameFROM table_dependenciesorder by Level DESC
once you get this list add delete from table where statements to delete data from tables------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/