Something like this perhaps:CREATE TABLE MyParent( ParentID INT NOT NULL, PRIMARY KEY ( ParentID ))GOCREATE TABLE MyChild( ParentID INT NOT NULL, ChildID INT NOT NULL, PRIMARY KEY ( ParentID, ChildID ))GOALTER TABLE dbo.MyChild WITH NOCHECK ADD CONSTRAINT FK_Test FOREIGN KEY ( ParentID ) REFERENCES dbo.MyParent ( ParentID )GOINSERT INTO MyParent(ParentID)SELECT 1000 UNION ALLSELECT 2000 UNION ALLSELECT 3000INSERT INTO MyChild(ParentID, ChildID)SELECT 1000, 1001 UNION ALLSELECT 1000, 1002 UNION ALLSELECT 2000, 2001 UNION ALLSELECT 2000, 2002 UNION ALLSELECT 3000, 3001 UNION ALLSELECT 3000, 3002GOPRINT 'Start delete test'GOSET NOCOUNT ONBEGIN TRANSACTIONDECLARE @intError int, @intRowCount intDELETE DFROM MyParent AS DWHERE ParentID = 1000SELECT @intError = @@ERROR, @intRowCount = @@ROWCOUNTIF @intError <> 0 OR @intRowCount <> 1BEGIN ROLLBACK PRINT 'Rollback'ENDELSEBEGIN COMMIT PRINT 'Commit'ENDSET NOCOUNT OFFGOPRINT 'End delete test'GODROP TABLE MyChildGODROP TABLE MyParentGO
Kristen