locked
How 'SET DEADLOCK PRIORITY {HIGH | NORMAL | LOW}' Work. RRS feed

  • Question

  • Hi

    I want to know how " Set Deadlock Priority" work. I want to run a insert command with high priority and also is i need to Set deadlock priority back to normal after execution of insert command with high priority or it automatically back to normal after execution of insert command.

    Thanks!

     
    Tuesday, November 8, 2016 9:42 AM

Answers

  • Why you want to change it?

    Are you facing any issues?

    This setting is for session level. When you change priority level, it for that session. Once you close session every thing is cleaned.

    If you are going to use same session for other executions, please set it to normal after insert.


    Regards,
    Rohit Garg
    (My Blog)
    This posting is provided with no warranties and confers no rights.
    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    • Marked as answer by nitraw26 Wednesday, November 9, 2016 5:08 AM
    Tuesday, November 8, 2016 11:52 AM

All replies

  • Why you want to change it?

    Are you facing any issues?

    This setting is for session level. When you change priority level, it for that session. Once you close session every thing is cleaned.

    If you are going to use same session for other executions, please set it to normal after insert.


    Regards,
    Rohit Garg
    (My Blog)
    This posting is provided with no warranties and confers no rights.
    Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    • Marked as answer by nitraw26 Wednesday, November 9, 2016 5:08 AM
    Tuesday, November 8, 2016 11:52 AM
  • if you want your script to be chosen as the deadlock victim over other scripts/processes run this:

    SET DEADLOCK_PRIORITY HIGH 

    If you want your script or session to run and minimize its chances of been selected the deadlock victim you would set it to low.

    Rohit is correct, this setting only applies to the current session or script. 

    Tuesday, November 8, 2016 11:56 AM
  • Thanks Rohit.

    I am facing deadlock issue due to which my insert statement do not execute.

    Tuesday, November 8, 2016 12:04 PM