BEGIN TRAN
INSERT INTO table (‘Food’)
BEGIN TRAN
INSERT INTO table (‘Beverages’)
COMMIT TRAN
ROLLBACK TRAN
In table will be folowing items:
A.
None
B.
Food
C.
Beverages
D.
Food And Beverages
BEGIN TRAN
INSERT INTO table (‘Food’)
BEGIN TRAN
INSERT INTO table (‘Beverages’)
COMMIT TRAN
ROLLBACK TRAN
In table will be folowing items:
BEGIN TRAN
INSERT INTO table (‘Food’)
BEGIN TRAN
INSERT INTO table (‘Beverages’)
COMMIT TRAN
ROLLBACK TRAN
In table will be folowing items:
A.
None
B.
Food
C.
Beverages
D.
Food And Beverages
http://msdn.microsoft.com/en-us/library/ms181299.aspx
Check out the link above. On the remarks section it says A transaction cannot be rolled back after a COMMIT TRANSACTION statement is executed.
I don’t understand why the answer for the above question is none.
Ref: http://msdn.microsoft.com/en-us/library/ms190295.aspx
“You cannot roll back a transaction after a COMMIT TRANSACTION statement is issued because the data modifications have been made a permanent part of the database.”
The correct answer is D. Food And Beverages
This are nested transactions. The answer should be A. None
CREATE TABLE #AA(Name nvarchar(40))
BEGIN TRAN
INSERT INTO #AA VALUES (‘Food’)
BEGIN TRAN
INSERT INTO #AA VALUES (‘Beverages’)
COMMIT TRAN
ROLLBACK TRAN
select * from #AA
i am totally agreed with magy
please update answer to A
waiting some comments about this for change .
Answer: A (None)
Explanation: With a nested transaction, a commit does not write any changes to disk, except for the top level transaction. A rollback, however works regardless of the level of the transaction, so yes, it will roll the inner transaction back.