Somthing like this .. Declare @tbl Table (Col1 int,Col2 char(1),Col3 char(1))Insert into @tbl(Col2,Col3)Select 'a','b' union allSelect 'c','d' union allSelect 'e','f' Update @tbl set col1 = b.rownum From (Select (Select Count(col2) From @tbl i Where i.col2 <= j.col2) As 'RowNum',* From @tbl j) AS b Inner Join @tbl c On b.Col2 = c.Col2Select * From @tbl
If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.