Home Forums SQL Server 7,2000 T-SQL UDF to create a counter RE: UDF to create a counter
renrob
SSC-Addicted
Points: 411
More actions
March 2, 2011 at 9:35 am
#1293590
This is about 3 years too late, but it worked for me:
SELECT [Field1]
, ROW_NUMBER() OVER (ORDER BY [Field1]) AS 'Row Number'
FROM [dbo].[MyTable]