• Yes it is a web application and the code calling the procedure is c#. Typically there are many users on the system doing this kind of order creation when this happens, it does not happen all the time. I am not a 100% sure that there is blocking when this problem occurs, but what I did was try to get two sequential orders get the same time of creation upto the millisecond and I was able to do that by creating a block with the process I had posted earlier. Also, because I have seen that this happens when different users are using this option about the same time, I assumed that the one having the problem must have had a little block from a previous user and then both his procedure calls land up completing at the same time. Do you think that may not be the reason, is it possible that even with no blocks on the table we could get the orderid's created at the exact same time and identity created OrderID returned out of sequence?

    Thanks.