I'm going to have to put some thought into doing this as two separate procs. One that only does the insert and another to do the other stuff. The whole transaction, as-is, is pretty big and probably takes too long. The insert is the most important part and probably should be by itself so it's less likely to be part of a failed transaction.
Then another to do all the necessary updates.
At face value, sounds like it'd reduce collisions, though I'm sure it's not the complete solution. Still need try/catch and need to determine and set the isolation level that's best for our scenario.
Register for free to join our community of investors and share your ideas. You will also get access to streaming quotes, interactive charts, trades, portfolio, live options flow and more tools.