How to get Row Number with the result of SQL select query?

How to get Row Number with the result of SQL select query?

Row Number concept not available in SQL Server 2000. It's introduced in SQL Server 2005.

The syntax of Row Number is

ROW_NUMBER () OVER ([] )

Example of Row Number is
[code]
SELECT ROW_NUMBER() OVER (ORDER BY FieldName ASC) AS ROWNO, * FROM Table_Name
[/code]

No comments:

Post a Comment

Plz Share your comments...