Microsoft Exam Questions

What is the result of each Transact-SQL statement?

HOTSPOT
You have the following stored procedure:

You run the following Transact-SQL statements:

What is the result of each Transact-SQL statement? To answer, select the appropriate options in the answer
area.
Hot Area:

Answer:

Explanation:
Box 1: All transactions are rolled back.
The first IF-statement, IF @CODE = ‘C2323’ AND @ApplicationID = 1, will be true, an error will be raised, the
error will be caught in the CATCH block, and the only transaction that has been started will be rolled back.
Box 2: Only Log1, Log2, and Log3 tables are updated.
The second IF-statement, IF @Code = ‘C2323’, will be true, so the second transaction will be rolled back, but
log1, log2, and log3 was updated before the second transaction.