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?

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?

A.
NOLOCK

B.
NOWAIT

C.
READPAST

D.
READUNCOMMITTED



Leave a Reply 0

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