PrepAway - Latest Free Exam Questions & Answers

Author: admin

What should be the expected outcome?

You have tables named Products and OrderDetails. The Products table has a foreign key relationship
with the OrderDetails table on the ProductID column. You have the following Transact-SQL batch:
BEGIN TRY

BEGIN TRANSACTION
DELETE FROM Products WHERE ProductID = 5;
BEGIN TRANSACTION

INSERT INTO OrderDetails
( OrderID, ProductID, Quantity )
VALUES
( 1234, 5, 12 );
COMMIT TRANSACTION

COMMIT TRANSACTION
END TRY
BEGIN CATCH ROLLBACK TRANSACTION PRINT ERROR_MESSAGE();
END CATCH
You need to analyze the result of executing this batch. What should be the expected outcome?

Which options should you set?

You have a single CLR assembly in your database. The assembly only references blessed assemblies from the Microsoft .NET Framework and does not access external resources.
You need to deploy this assembly by using the minimum required permissions. You must ensure that your database remains as secure as possible.
Which options should you set?

Which Transact-SQL statement should you use?

Your database contains two tables named Order and OrderDetails that store order information. They relate to each other using the OrderID column in each table. Your business requires that the LastModifiedDate column in the Order table must reflect the date and time when a change is made in the OrderDetails table for the related order.
You need to create a trigger to implement this business requirement.
Which Transact-SQL statement should you use?