Which statements will be committed?

You are a database developer on an instance of SQL Server 2008. You are creating an application that will be used by the inventory department. You write the following Transact-SQL code:
BEGIN TRANSACTION
INSERT INTO InvLookup VALUES (1, ‘Finished Goods’);
BEGIN TRANSACTION
INSERT INTO InvLookup VALUES (7, ‘Component’);
COMMIT TRANSACTION;
UPDATE InvTemp SET ProcFlg = ‘X’WHERE InvID IN (SELECT InvID FROM InvMaster);
UPDATE InvMaster SET ProcFlg = ‘Y’;
ROLLBACK TRANSACTION;
Assuming all DML statements in both the inner and outer transaction process successfully, which statements will be committed?
A. only the statements in the inner transaction
B. only the statements in the outer transaction
C. none of the statements in either the inner or outer transaction
D. all of the statements in both the inner and outer transactions

microsoft-exams

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.