SSTS Blog

Some news and tidbits that we share

SQL Server - SET DEADLOCK PRIORITY

by SSTS
SSTS
Server Side Technology Solutions is a consulting firm that specializes in databa
User is currently offline
on Jul 13 in Blog 0 Comments

If two database sessions are deadlocked SQL Server will by default select the lowest cost rollback as the "deadlock victim". There is a way to influence SQL Server if you would like a process to avoid being a deadlock victim. Simply, add a call to your code "SET DEADLOCK_PRIORTY HIGH". This can either be called from your database session or from within a stored procedure that you call. Not, that this should be used in specific situations. If you use it everywhere you will defeat the purpose since if two sessions have this setting and run into a deadlock situation SQL Server will default back to the lowest cost algorithm.

 

Tags: Untagged
Hits: 92712

About the author

SSTS

Server Side Technology Solutions is a consulting firm that specializes in database design, development and support.

Comments

Please login first in order for you to submit comments