How to set the deadlock priority for a maintenance task

  • We have two maintenance tasks which occasionally conflict resulting in a deadlock. One runs a History Cleanup Task and the other runs our Transaction Log backups.

    When a deadlock occurs, the Transaction Log backup task is chosen as the deadlock victim. I would like to set the Deadlock Priority so that the history cleanup task is always chosen as the victim. However I cannot see where to do this either in the Maintenance Plan properties or in the SQL Agent job properties.

    Is it possible to do this?

  • You can use

    SET DEADLOCK_PRIORITY n

    n=-10 lowest

    n=10 highest priority

    Read more for the priority here https://msdn.microsoft.com/en-us/library/ms186736.aspx

    Igor Micev,My blog: www.igormicev.com

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply