PrepAway - Latest Free Exam Questions & Answers

BEGIN TRAN INSERT INTO table (‘Food’) BEGIN TRAN INSERT INTO table (‘Beverages’) COMMI

BEGIN TRAN
INSERT INTO table (‘Food’)
BEGIN TRAN
INSERT INTO table (‘Beverages’)
COMMIT TRAN
ROLLBACK TRAN

In table will be folowing items:

PrepAway - Latest Free Exam Questions & Answers

A.
None

B.
Food

C.
Beverages

D.
Food And Beverages

7 Comments on “BEGIN TRAN INSERT INTO table (‘Food’) BEGIN TRAN INSERT INTO table (‘Beverages’) COMMI

  1. magy says:

    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




    0



    0
      1. Ani says:

        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.




        0



        0

Leave a Reply