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

Answer Posted / raman

If you want row id as ROWID in Oracle, use %%physloc%% to
get unique id for each row in a table.
Ex. Query to get physical address/rowid of first row in
table.
SELECT TOP 1 %%physloc%% AS ROWID FROM <UrTable>

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What command do we use to rename a db, a table and a column?

700


Some queries related to SQL

761


What is single-user mode and what are the steps you should follow to start sql server in single-user mode?

770


Explain the first normal form(1nf)?

787


Explain user defined functions?

814


What is difference between oltp and olap?

826


What area unit the various kinds of info compression introduced in sql server 2008?

795


How to create a simple stored procedure in ms sql server?

762


Explain important index characteristics?

795


Why functions are used in sql server?

700


What is data source document?

807


How to get the definition of a stored procedure back?

735


Explain different backup plans?

722


What is SubQuery in SQL Server 2008

754


If a user does not have permission to a table, but has permission to a view created on it, will he be able to view the data in table?

756