It\'s possible to delete using join statements to qualify the set to be deleted, such as the following:
DELETE J FROM Users U inner join LinkingTable J on U.
Use TRY CATCH with Transaction
BEGIN TRANSACTION BEGIN TRY DELETE from A WHERE id=1 DELETE FROM b WHERE id=1 COMMIT TRANSACTION; END TRY BEGIN CATCH ROLLBACK TRANSACTION; END CATCH
or you can also use Store procedure for same Using Stored Procedure With Transaction: