>Boris,
>
>Good point about table variables!
>
>I don't think you got it right, though it's a very interesting solution. I added an identity field to the TestOrders table to check it.
>
>We need record 2 to become 5.
And how we should handle the GAP?
Maybe 5 must becomes 2?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.