Unanswered: How to get a similar value to Oracle's ROWID?
I'm trying to find out how to get the following SQL statment on SQL Server:
select max(rowid) from temp_tab1;
N.B.: The sql above was run on an Oracle DB to return the max row id given by the server (not the table's primary key). I know I can get a similar result if I query my primary key, but that's not the case. I need the DB row id given.
RowID is a built in feature that is created with every table in ORACLE. For SQL Server you would need to create a column in your table with the property of IDENTITY, check Book On Line. This is a system maintained column.
ROWGUIDCOL, is a bit of an over kill. It doesn't generate numbers but globally unique identifier (GUID), like 6F9619FF-8B86-D011-B42D-00C04FC964FF. This is mainly used with replication, when tables from different sites need to merge data.
Look at the IDENTITY property which will generate numeric values. A column with this property is maintained by the system. See Books Online for more information.