I am trying to understand partial roll backs, in TSQL. Following a tutorial i found this example but I do not understand / find can you save to a table the second object if the first fails?
BEGIN TRAN
PRINT 'First Transaction: ' + CONVERT(VARCHAR,@@TRANCOUNT)
INSERT INTO People VALUES ('Tom')
BEGIN TRAN
PRINT 'Second Transaction: ' + CONVERT(VARCHAR,@@TRANCOUNT)
INSERT INTO People VALUES ('Dick')
ROLLBACK TRAN
PRINT 'Rollback: ' + CONVERT(VARCHAR,@@TRANCOUNT)
So if 'Tom' fails can I save 'Dick' ? I need this, for achieving a many-to-many roll back transaction. So i create Obj A, Obj B and if both succes add Obj C, if not roll back failure, and keep the successing INSERT query.