Wednesday, January 1, 2020

SET DEADLOCK_PRIORITY

Alright, in T-SQL this could be...

SET DEADLOCK_PRIORITY LOW

 
 

or...

SET DEADLOCK_PRIORITY NORMAL

 
 

or...

SET DEADLOCK_PRIORITY HIGH

 
 

Or, instead of LOW, NORMAL, and HIGH it could be a number from -10 to 10. LOW is a stand in for -5, NORMAL for 0, and HIGH for 5. This tries to determine how "important" it is, vaguely, for a session to keep struggling when it is deadlocked with another. If a database is stuck in SINGLE_USER mode you may break it out like so perhaps:

SET DEADLOCK_PRIORITY 10
ALTER DATABASE YourNameHere SET MULTI_USER

No comments:

Post a Comment