• Joe Torre - Thursday, February 1, 2018 3:16 PM

    Try doing both in a single transaction:

    begin tran
       delete tbl1 where ...
       delete tbl2 where...
    commit;

    Won't work. Constraints are checked at the statement level. The first statement will violate the constraints and fail. The second will then violate the constraints and fail as well.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass