70-451 · Question #27
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…
The correct answer is A. 1. Add a SET XACT_ABORT OFF statement in IncludeDetails. See the full explanation below for the reasoning.
Question
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. 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?
Exhibit
Options
- A
- Add a SET XACT_ABORT OFF statement in IncludeDetails.
- B
- Add a SET XACT_ABORT ON statement in IncludeDetails.
- C
- Enclose all statements of IncludeDetails in a TRY/CATCH block.
- D
- Enclose all statements of ImportNewProducts in a TRY/CATCH block.
How the community answered
(26 responses)- A73% (19)
- B4% (1)
- C15% (4)
- D8% (2)
Community Discussion
No community discussion yet for this question.
