/// <summary> /// Sets the deadlock priority of the database transaction. /// </summary> /// <remarks> /// This is required for low priority job polling operations. /// Refer to SQL Books Online for more information on the SET DEADLOCK_PRIORITY statement. /// </remarks> /// <param name="priority">Deadlock priority of the transaction.</param> public void SetDeadlockPriority(DeadlockPriority priority) { if (!isValid) { throw new InvalidOperationException(); } string sql = String.Format("SET DEADLOCK_PRIORITY {0}", priority.ToString()); using (SqlCommand cmd = CreateTextCommand(sql)) { cmd.ExecuteNonQuery(); } }