What is the result?

You manage a database on an instance of SQL Server 2008 at a large educational institution. You have ClassMaster and ClassDetail tables as shown:
(Click exhibit to view table design)
The User1 user starts a session and executes the following Transact-SQL:
BEGIN TRANSACTION
UPDATE ClassDetail WITH(TABLOCK)
SET ClassDetail.Details = ClassDetail.Details + ‘. This is a Freshman-level class.’
FROM ClassMaster INNER JOIN
ClassDetail ON ClassMaster.ClassID = ClassDetail.ClassID
WHERE ClassMaster.Level = ‘Freshman’;
Then, User2 starts a session and executes the following Transact-SQL:
BEGIN TRANSACTION
INSERT INTO ClassMaster(Description, Seats, Level)
VALUES (‘Calculus I’, 25, ‘Sophomore’),
(‘Accounting III’, 80, ‘Senior’),
(‘World History’, 30, ‘Freshman’);
DELETE FROM dbo.ClassDetail WHERE CDID = 2;
COMMIT TRANSACTION
What is the result?
Exhibit:


A. User1’s updates are applied first, and then User2’s DML operations are performed.
B. User2’s session hangs waiting for User1’s update to complete.
C. User1’s updates are not performed, but User2’s DML operations complete successfully.
D. User2’s session immediately returns an error.

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.