Hi,What is the best to update line_no in following code.As you can see 1 invoice can have multiple lines.I would like to assign sequential number to all lines in invoice.CREATE TABLE #xx (invoicenumber INT, line_no int )INSERT INTO #xx VALUES(1000,0)INSERT INTO #xx VALUES(1000,0)INSERT INTO #xx VALUES(1000,0)INSERT INTO #xx VALUES(1000,0)INSERT INTO #xx VALUES(2000,0)INSERT INTO #xx VALUES(2000,0)INSERT INTO #xx VALUES(2000,0)INSERT INTO #xx VALUES(2000,0)SELECT * FROM #xx
result of select * from #xx should be:1000 11000 21000 31000 42000 12000 22000 32000 4Thanksmk_garg