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

Answer Posted / dhivakar

SELECT
ROW_NUMBER() OVER (ORDER BY emp_id) AS rowid,
*
FROM employee

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it ok to shrink transaction log?

519


Tell me what is difference between view and materialized view?

525


What are the functions in sql server?

549


What is data source object?

557


What is primary key, unique key, and foreign key?

542






How to return the date part only from a sql server datetime datatype?

581


How does stuff differ from the replace function?

555


Why would you use sql agent?

735


Do you know query execution plan?

588


difference between Clustered index and non clustered index ?

581


What are the differences between “row_number()”, “rank()” and “dense_rank()”?

543


How to provide login information for a new odbc dsn?

540


Other than truncate statement, which other command can by-pass the trigger on the tables?

624


What is a subquery in a select query statement in ms sql server?

591


Find first and last day of current month in sql server

597