PrepAway - Latest Free Exam Questions & Answers

Which locking hint should you use in RetrieveProducts?

You are a database developer. You plan to design a database solution by using SQL Server 2008. The database contains a table named Products. The database has two stored procedures named ModifyProduct and RetrieveProducts. ModifyProduct updates a single row in the Products table. RetrieveProducts returns all rows from the Products table. RetrieveProducts is used by a report. Users who run the report experience contention problems. You discover that RetrieveProducts is being blocked by ModifyProduct. The report must not include rows that are currently being modified. You need to ensure that the report is executed as quickly as possible. Which locking hint should you use in RetrieveProducts?

PrepAway - Latest Free Exam Questions & Answers

A.
NOLOCK

B.
NOWAIT

C.
READPAST

D.
READUNCOMMITTED

Explanation:
READPAST Specifies that the Database Engine not read rows that are locked by other transactions. READPAST is primarily used to reduce locking contention when implementing a work queue that uses a SQL Server table. A queue reader that uses READPAST skips past queue entries locked by other transactions to the next available queue entry, without having to wait until the other transactions release their locks.


Leave a Reply