Question : Need Syntax to Auto Increment a Number in SQL Server 2008

I need the syntax to Auto Increment a number in a field, starting with the number "1" and going higher for each row.

What is the syntax to do this?

Thanks
M

Answer : Need Syntax to Auto Increment a Number in SQL Server 2008

correction

select rownum=row_number() over (order by somefield), *
FROM
(
select * from tbl
) SQ

replace "somefield" with an actual field
Random Solutions  
 
programming4us programming4us