I have two stored procedures, one of which is called a lot and is thus very simple and executes well. Additionally, these actually work very nicely in paralell even though they are serializable.
However I have a second query that is only called in certain circumstances which needs to do many more checks before touching the same tables. Problem is when you run these in parallel you end up with a deadlock as each stored proc locks in different orders.
My question is can you force a given sproc to take it's locks in a specific order to match your important query(s)? That way they will not deadlock and execute nicely :).
EDIT: As a clarification, what I want my second procedure to do is this.
--Lock table1
--Lock table2
--Perform query.