>in vfp i do :
>replace all myfield with recno()
>
>and the command re-number the field.
>
>how can i do it in sqlserver ?
In SQL 2005 and up look at ROW_NUMBER function, e.g.
;with cte as (select myfield, row_number() over (order by SomeField) as NewNumber from myTable)
update cte set myField = NewNumber
If it's not broken, fix it until it is.
My Blog