nerdexam
Microsoft

70-465 · Question #52

You need to recommend a solution that addresses the concurrency requirement. What should you recommend?

The correct answer is B. Modify the stored procedures to update tables in the same order for all of the stored. Deadlocks in SQL Server commonly occur when stored procedures access tables in inconsistent orders, causing circular wait conditions. Ensuring all procedures update tables in the same order eliminates this circular dependency.

Submitted by yaw92· Mar 5, 2026Design and implement database solutions for SQL Server

Question

You need to recommend a solution that addresses the concurrency requirement. What should you recommend?

Options

  • ACall the stored procedures in a Distributed Transaction Coordinator (DTC) transaction.
  • BModify the stored procedures to update tables in the same order for all of the stored
  • CMake calls to Sales.Proc1 and Sales.Proc2 synchronously.
  • DBreak each stored procedure into two separate procedures, one that changes

How the community answered

(39 responses)
  • A
    3% (1)
  • B
    79% (31)
  • C
    5% (2)
  • D
    13% (5)

Why each option

Deadlocks in SQL Server commonly occur when stored procedures access tables in inconsistent orders, causing circular wait conditions. Ensuring all procedures update tables in the same order eliminates this circular dependency.

ACall the stored procedures in a Distributed Transaction Coordinator (DTC) transaction.

Using a DTC transaction adds distributed transaction overhead and still does not prevent deadlocks if the underlying table access order remains inconsistent across procedures.

BModify the stored procedures to update tables in the same order for all of the storedCorrect

When multiple stored procedures acquire locks on the same tables but in different orders, they can create circular wait chains that result in deadlocks. By standardizing the table update order across all stored procedures, you ensure that locks are always requested in the same sequence, preventing circular dependencies and resolving the concurrency/deadlock issue without requiring distributed transactions or architectural changes.

CMake calls to Sales.Proc1 and Sales.Proc2 synchronously.

Making calls to Sales.Proc1 and Sales.Proc2 synchronously serializes application-level execution but does not address deadlocks that occur within the database engine due to inconsistent lock ordering across concurrent sessions.

DBreak each stored procedure into two separate procedures, one that changes

Breaking each stored procedure into two separate procedures does not inherently resolve deadlocks unless the resulting procedures also update tables in a consistent order, making this an incomplete and unnecessarily complex solution.

Concept tested: Deadlock prevention via consistent table update ordering

Source: https://learn.microsoft.com/en-us/sql/relational-databases/sql-server-deadlocks-guide

Topics

#Concurrency control#Deadlock prevention#Transaction management#Stored procedure design

Community Discussion

No community discussion yet for this question.

Full 70-465 Practice