Developing SQL Databases — Question 52

You are designing a stored procedure for a database named DB1.
The following requirements must be met during the entire execution of the stored procedure:
✑ The stored procedure must only read changes that are persisted to the database. statements within the stored procedure should only show changes to the data that are made by the stored procedure.
✑ SELECT
You need to configure the transaction isolation level for the stored procedure.
Which Transact-SQL statement or statements should you run?

Answer options

Correct answer: B

Explanation

The correct answer is B because it sets the transaction isolation level to READ COMMITTED, ensuring that the stored procedure only reads committed changes. Option A is incorrect as it uses READ UNCOMMITTED and enables snapshot isolation, which does not meet the requirement. Option C sets the isolation level to SERIALIZABLE, which is stricter than necessary. Option D also uses READ UNCOMMITTED, failing to fulfill the requirement of reading only committed changes.