how to get the rowid/rownumbes of a table in sqlserver

Answer Posted / vimal

SELECT ROW_NUMBER() OVER(ORDER BY eName ASC) AS Rno, *
FROM emp

asc or desc required

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does index makes search faster?

604


How to provide values to user defined function parameters?

557


Do you know what are the differences between lost updates and uncommitted dependencies?

546


What is the difference between substr and charindex in the sql server?

511


What is the purpose of forms?

498






What is use of dbcc commands?

629


What are the aggregate and scalar functions?

527


What is tempdb database? : SQL Server Architecture

607


What are different types of replication in sql server?

572


When multiple after triggers are attached to sql table, how to control the order of execution?

532


What is a rollup clause?

547


You want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition?

539


Can we linked SharePoint to a SQL database?

594


What is use of attribute hierarchy optimized state? : sql server analysis services, ssas

588


In what three ways is the return statement used in a stored procedure?

514