{"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.
\nThe session that has lower DEADLOCK_PRIORITY will be chosen as a victim for deadlock.<\/em><\/p>\n

\"Dead<\/p>\n

Syntax:<\/strong>
\n[sql]
\nSET DEADLOCK_PRIORITY value
\n[\/sql]<\/p>\n

Value Can Be:<\/em>
\nLOW
\nNORMAL
\nHIGH
\nNumeric value from -10 to 10<\/p>\n

Example:<\/strong>
\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

Note: <\/strong>
\nNumeric equivalent values of DEADLOCK_PRIORITY.
\nHIGH = 5
\nNORMAL = 0
\nLOW = -5<\/p>\n

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],"_links":{"self":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/209"}],"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}]}}