70-451 · Question #110
You are a database developer. You plan to design a database solution by using SQL Server 2008. A database contains a large non-partitioned table with 4 million rows. You write a stored procedure…
The correct answer is D. Add the TABLOCK hint to the UPDATE statement in the procedure. See the full explanation below for the reasoning.
Question
You are a database developer. You plan to design a database solution by using SQL Server 2008. A database contains a large non-partitioned table with 4 million rows. You write a stored procedure that updates approximately 4,000 rows in the table. The stored procedure is scheduled to run only during peak hours. The stored procedure runs frequently. Users report performance issues. You discover that when the stored procedure runs, it results in memory contention because of a high number of locks placed on the table. You need to ensure that the SQL Server 2008 server places the minimum possible number of locks on the table while the stored procedure is being executed. What should you do?
Options
- Aset the LOCK_ESCALATION option of the table to AUTO.
- BAdd the PAGLOCK hint to the UPDATE statement in the procedure.
- CDisable the LOCK_ESCALATION option of the table.
- DAdd the TABLOCK hint to the UPDATE statement in the procedure.
How the community answered
(32 responses)- A16% (5)
- B6% (2)
- C3% (1)
- D75% (24)
Community Discussion
No community discussion yet for this question.