PrepAway - Latest Free Exam Questions & Answers

You need to ensure that the following requirements are met…

You are a database developer. You develop solutions by using SQL Server 2008 in an
enterprise environment. An application contains two stored procedures. The tasks
performed by the stored procedures are as shown in the following table. You discover that
the procedures occasionally throw foreign key violation errors. IncludeDetails throws an
error when it inserts records into the ProductInfo table. ImportNewProducts throws an error
when it inserts records into the ProductCurrentPrice table. You need to ensure that the
following requirements are met: ·If an error occurs in the INSERT statement of ProductInfo,
records inserted into ProductHeader and ProductCurrentPrice are committed. ·If an error
occurs in the INSERT statement of ProductCurrentPrice, all transactions are rolled back.
What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
1·Enclose all statements of ImportNewProducts in a TRY/CATCH block. 2·Add a
ROLLBACK TRANSACTION statement in the CATCH block.

B.
1·Enclose all statements of IncludeDetails in a TRY/CATCH block. 2·Add a ROLLBACK
TRANSACTION statement in the CATCH block.

C.
1. Add a SET XACT_ABORT OFF statement in IncludeDetails. 2. Add a SET
XACT_ABORT ON statement in ImportNewProducts.

D.
1·Add a SET XACT_ABORT ON statement in IncludeDetails. 2·Add a SET
XACT_ABORT OFF statement in ImportNewProducts.


Leave a Reply