Mike,
Do you know ahead of time what the ItemNo that was deleted? If so a single update statement could do it:
update orderfl
set itemno = itemno - 1
where invfld = 2414629 and itemno > @DeletedItemNo
>I have an order table that contains the line items of our orders. This table has two fields itemno ( sequence that line items where entered ) and the table orderflid ( identity field ).
>When an line is removed from the middle, I would like to renumber the ItemNo in order of identity field with out using a dowhile.
>
>I’m using this syntax:
>
>declare @itemno int
>set @Itemno = 0
>update orderfl set @Itemno = @Itemno + 1, itemno = @Itemno
>where invflid = 2414629
>
>
>How can I assure this is done in the ascending identity sequence ( 1st to last ).