Click here to Skip to main content
12,243,721 members (50,029 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

2.9K views
Posted

Generate auto row number for a table

, 28 Sep 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
SELECT ROW_NUMBER() OVER(ORDER BY [col_1]) as RowNumber,COUNT([col_1]) OVER () AS RecordCount,* FROM TableName
SELECT ROW_NUMBER() OVER(ORDER BY [col_1]) as RowNumber,
COUNT([col_1]) OVER () AS RecordCount,* FROM TableName

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Mukund Thakker
Technical Lead
India India
Tech Lead
MCTS - .NET Framework 4.0, Web Applications

Blog : http://thakkermukund.wordpress.com
Twitter@thakkermukund

Don't code today, what you can't debug tomorrow!
Everything makes sense in someone's mind

You may also be interested in...

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160426.1 | Last Updated 28 Sep 2011
Article Copyright 2011 by Mukund Thakker
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid