70-465 · Question #94
You work as a Database Administrator (DBA) for a company named ABC.com. The company uses a Microsoft SQL Server 2012 infrastructure. You have a database named CorpDB. You plan to create a stored…
The correct answer is A. You should configure the stored procedure to use the READ UNCOMMITTED isolation level. To support dirty reads for a stored procedure in SQL Server 2012, the transaction isolation level must be configured to allow reading uncommitted data. This specific behavior is enabled by the READ UNCOMMITTED isolation level.
Question
Options
- AYou should configure the stored procedure to use the READ UNCOMMITTED isolation level.
- BYou should configure the stored procedure to use the READ COMMITTED isolation level.
- CYou should configure the stored procedure to use the READ SERIALIZABLE isolation level.
- DYou should configure the stored procedure to use the REPEATABLE READ isolation level.
- EYou should configure the stored procedure to use the SNAPSHOT isolation level.
How the community answered
(31 responses)- A94% (29)
- B3% (1)
- E3% (1)
Why each option
To support dirty reads for a stored procedure in SQL Server 2012, the transaction isolation level must be configured to allow reading uncommitted data. This specific behavior is enabled by the READ UNCOMMITTED isolation level.
The READ UNCOMMITTED isolation level allows a transaction to read data that has been modified by other transactions but not yet committed, which is precisely what is meant by a 'dirty read'. This provides the lowest level of transaction isolation, sacrificing data consistency for maximum concurrency by not placing shared locks and ignoring exclusive locks.
The READ COMMITTED isolation level prevents dirty reads by ensuring that a transaction can only read data that has been committed by other transactions.
The SERIALIZABLE isolation level provides the highest level of transaction isolation, preventing dirty reads, non-repeatable reads, and phantom reads.
The REPEATABLE READ isolation level prevents dirty reads and non-repeatable reads by ensuring that any data a transaction reads remains locked until the transaction completes.
The SNAPSHOT isolation level provides a transactionally consistent view of the database as it existed at the start of the transaction, thereby preventing dirty reads and other concurrency issues.
Concept tested: SQL Server Transaction Isolation Levels and Dirty Reads
Source: https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-transaction-isolation-levels?view=sql-server-ver16
Topics
Community Discussion
No community discussion yet for this question.