Is there a ROW ID

  • In SQL Server, is there a row ID or "internal unique identifier" that can be retrieved for each row in a table so that I can query for individual rows explicitly without relying on primary key values?

    It seems to me Oracle had a ROWID column that served that function exactly.  I would like to do that in SQL Server if possible.

    Thanks!

    Mark

  • You should look up ROWGUIDCOL on BOL....good starting point!







    **ASCII stupid question, get a stupid ANSI !!!**

  • ......sql server has identity column.

     

    cheers.

     

  • There is a primary difference between ROWID of oracle and Identity of SQL Server.   You ROWID is implicitly available in Oracle.  In SQL Server You need to add that column.

    I always maintain Identity column (except for intermediate tables on Many-Many relationships and child table of 1-1 relationship) and query data using that.

    The point is this is part of the table. You need to create it explicitly

    Cheers,
    Prithiviraj Kulasingham

    http://preethiviraj.blogspot.com/

  • If you are specifying internal physical properties for retrieving rows you are not really querying the database, you are telling it what to do. In fact, I would even say you are not using rows and tables (sets) at all, you are back to the old days of records and files. Why use a relational database management system if you are not using it in a relational manner?

    The answer is no, SQL Server does not have a similar feature as Oracle's ROWID. And for that we should be thankful to Microsoft.

  • AMEN!!

  • Check out rowversion & timestamp too.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply