cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

Custom Alert - best practice for a long running query?

I have a custom alert that runs daily, and the query takes about a minute. I noticed it was the victim of a deadlock recently, and I want to ensure that it will always be the victim. The target is SQL Server 2012.

Does DPA use a low priority session? Is there something I should do to ensure that my custom alert's query won't win in a future deadlock event?

There's little I can do to improve this particular query, and it's reading from a large table that can't be altered. I can't create new indexes on it; that would invalidate product support.

Thanks

 

 

Labels (1)
0 Kudos
1 Reply
Level 17

@SeanM 

Not sure DPA sets the deadlock priority to be low. You could try putting this code at the top of the custom alert script and see if it works:

SET DEADLOCK_PRIORITY LOW;

<custom alert script here>

HTH

0 Kudos