Transaction Server Question:
Download Questions PDF

Do you know nested transaction?

Answer:

A nested transaction is one in which a new transaction is started by an instruction that is already inside another transaction. This new transaction is said to be nested. The isolation property of transaction is obeyed here because the changes made by the nested transaction are not seen or interrupted by the host transaction.

BEGIN TRANSACTION trans_1
INSERT INTO TestTrans1 VALUES (1,’mark’)
COMMIT TRANSACTION trans_1;
GO
/* Start a transaction and execute trans_1. */
BEGIN TRANSACTION trans_2;
GO
EXEC trans_1 1, 'aaa'; //execute some procedure
GO
ROLLBACK TRANSACTION trans_2;
GO
EXECUTE TransProc 3,'bbb';
GO

Download MS SQL Server Transaction Interview Questions And Answers PDF

Previous QuestionNext Question
What is Transaction Server Distributed transaction?Please explain the characteristics of a transaction server for example Atomicity, Consistency, Isolation, Durability?