SyntaxFix
Write A Post
Hire A Developer
Questions
Try ROW_NUMBER()
http://msdn.microsoft.com/en-us/library/ms186734.aspx
Example:
SELECT col1, col2, ROW_NUMBER() OVER (ORDER BY col1) AS rownum FROM tbl