{"id":209,"date":"2012-05-16T07:52:32","date_gmt":"2012-05-16T07:52:32","guid":{"rendered":"https:\/\/sqlserverlearner.azurewebsites.net\/2012\/05\/16\/deadlock_priority\/"},"modified":"2012-05-16T07:52:32","modified_gmt":"2012-05-16T07:52:32","slug":"deadlock_priority","status":"publish","type":"post","link":"https:\/\/sqlserverlearner.com\/2012\/05\/16\/deadlock_priority\/","title":{"rendered":"DEADLOCK_PRIORITY"},"content":{"rendered":"
DEADLOCK_PRIORITY<\/strong> is used to specify the priority of a session when deadlocked by other session. <\/p>\n Syntax:<\/strong> Value Can Be:<\/em> Example:<\/strong> Note: <\/strong> Applicable to SQL Server 2000,SQL Server 2005,SQL Server 2008,SQL Server 2008 r2,SQL Server 2012<\/p>\n","protected":false},"excerpt":{"rendered":" DEADLOCK_PRIORITY is used to specify the priority of a session when deadlocked by other session. The session that has lower DEADLOCK_PRIORITY will be chosen as a victim for deadlock. Syntax: [sql] SET DEADLOCK_PRIORITY value [\/sql] Value Can Be: LOW NORMAL HIGH Numeric value from -10 to 10 Example: To set HIGH DEADLOCK_PRIORITY to a connection:…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1946],"tags":[1968,1969,1970,1971,1972,1973,1974,1975],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-dead-lock","tag-deadlock_priority","tag-set-deadlock_priority","tag-set-deadlock_priority-0","tag-set-deadlock_priority-10","tag-set-deadlock_priority-high","tag-set-deadlock_priority-low","tag-set-deadlock_priority-normal","tag-sql-server-set-deadlock_priority"],"_links":{"self":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":0,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\nThe session that has lower DEADLOCK_PRIORITY will be chosen as a victim for deadlock.<\/em><\/p>\n
\n[sql]
\nSET DEADLOCK_PRIORITY value
\n[\/sql]<\/p>\n
\nLOW
\nNORMAL
\nHIGH
\nNumeric value from -10 to 10<\/p>\n
\nTo set HIGH DEADLOCK_PRIORITY to a connection:
\n[sql]
\nSET DEADLOCK_PRIORITY HIGH
\n[\/sql]
\nOR
\n[sql]
\nSET DEADLOCK_PRIORITY 5
\n[\/sql]
\nOR
\n[sql]
\nDECLARE @A VARCHAR(10)
\nSET @A = ‘HIGH’
\nSET DEADLOCK_PRIORITY @A
\n[\/sql]
\nOR
\n[sql]
\nDECLARE @A INT
\nSET @A = 5
\nSET DEADLOCK_PRIORITY @A
\n[\/sql]<\/p>\n
\nNumeric equivalent values of DEADLOCK_PRIORITY.
\nHIGH = 5
\nNORMAL = 0
\nLOW = -5<\/p>\n