What should you include in the design?

You are building a stored procedure for a Windows Azure SQL Database. The procedure will
add multiple rows to a table.
You need to design the stored procedure to meet the following requirements:
If any of the new rows violates a table constraint, then no further additions must be
attempted and all changes made by the stored procedure must be discarded.
If any errors occur, a row must be added to an audit table, and the original error must be
returned to the caller of the stored procedure.
What should you include in the design?

You are building a stored procedure for a Windows Azure SQL Database. The procedure will
add multiple rows to a table.
You need to design the stored procedure to meet the following requirements:
If any of the new rows violates a table constraint, then no further additions must be
attempted and all changes made by the stored procedure must be discarded.
If any errors occur, a row must be added to an audit table, and the original error must be
returned to the caller of the stored procedure.
What should you include in the design?

A.
An explicit transaction that has XACT_ABORT disabled

B.
An implicit transaction that has error handling enabled

C.
An explicit transaction that has error handling enabled

D.
An implicit transaction that has XACT.ABORT enabled



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Vovka

Vovka

C and D

Skippo

Skippo

How do you reckon that option D would achieve this: “If any errors occur, a row must be added to an audit table, and the original error must be returned to the caller of the stored procedure”?!

The only correct option is C.