Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does a system primary key or unique identifier for each row in a table exist? Like @@ROWID, @@IDENTIFER, or some other identifier that uniquely identifies each row regardless of how it was created? Using SQL Server 2000 through SQL Server 2012.

share|improve this question

migrated from May 17 '13 at 14:13

This question came from our site for professional and enthusiast programmers.

No, at least nothing you can get your hands on easily. Every row has some system-level location information - file id, page id and offset inside the page - but that information is very much internal to SQL Server and not easily accessible from the outside (and definitely not useable to select your row from T-SQL!) – marc_s May 17 '13 at 4:55
Do you mean like ROWID in Oracle? No. – Aaron Bertrand May 17 '13 at 14:35

In practical terms from a code or user perspective, no.

There is one internally (rid) but it is not exposed in any documented system view or function

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.