What is the result?

You are a database developer on an instance of SQL Server 2008. The Donation table in your database was created using the following statement:
CREATE TABLE Donation (
DonationID int PRIMARY KEY,
DonorID int,
PledgeAmt money CHECK (PledgeAmt > 0),
PledgeDate datetime DEFAULT GETDATE());
The Donation table currently contains no data.
You execute the following Transact-SQL in SQL Server Management Studio:
SET XACT_ABORT ON
BEGIN TRANSACTION
INSERT INTO Donation VALUES(2, 1, 500, ’12-01-2008′);
INSERT INTO Donation VALUES(1, 3, 0, ’12-15-2008′);
INSERT INTO Donation VALUES(3, 7, 250, DEFAULT);
COMMIT TRANSACTION
What is the result?
A. The Transact-SQL executes successfully and inserts two rows into the Donation table.
B. The Transact-SQL executes successfully and inserts three rows into the Donation table.
C. The Transact-SQL generates an error message, but inserts two rows into the Donation table.
D. The Transact-SQL generates an error message and rolls back all inserts.

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.