July 6, 2005 at 8:00 pm
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
July 6, 2005 at 8:47 pm
You should look up ROWGUIDCOL on BOL....good starting point!
**ASCII stupid question, get a stupid ANSI !!!**
July 6, 2005 at 10:49 pm
......sql server has identity column.
cheers.
July 7, 2005 at 12:32 am
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/
July 7, 2005 at 1:52 am
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.
July 7, 2005 at 6:40 am
AMEN!!
July 8, 2005 at 6:34 am
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