Monday, March 12, 2012

Oracle RowID in SQLServer?

Hi,
In Oracle we have a datatype called 'ROWID' - Oracle uses this datatype to store the address (rowid) of every row in the database. Do we have any equivalent datatype in SQLServer similar to this ?
Regards,
SnNo. At least not in SQL Server 2000.

Data in a relational database has no inherent order. That said, I think that this functionality has been implemented in 2005 anyway.

There are alternative ways of achieving the same effect in SQL Server, depending upon what you want to use the row number for. Are you doing paging?|||That said, I think that this functionality has been implemented in 2005 anyway.
Say it ain't SO!!!!

I can't believe Uncle Bill is caving in to the Oracle crowd (though I grew up on Tandem SQL, and it had the concept of row numbers also).

That is just SO wrong.

Jeeze. I'm going to retire early and head to my cabin in the deep, dark Idaho forest with my Commodore 64.|||yes, in 2005 there is RANK(), DENSE_RANK(), and ROW_NUMBER() which all do similar things:

http://msdn2.microsoft.com/en-us/library/ms186734.aspx|||OK, so listen up all y'all...

let's all agree we won't use such constructs even though they are available, shall we? ;)

Kinda similar to urban assault weapons...just because they exist, doesn't make it right to use them ;)|||They can have my row_number when they pry it from my cold dead data.|||Well, there is a crucial difference. The row_number of a row in SQL 2005 can change, but the rownum in oracle can not, as it is stored with the data itself. That should keep the Oracle folks on their toes for a considerable while.|||I have a guilty secret....

I have been using row_number for a little while now to satisfy TOP x BY GROUP queries for tables with wide composite keys.

Does that mean I can't join your gang? :o|||I have a guilty secret....

I have been using row_number for a little while now to satisfy TOP x BY GROUP queries for tables with wide composite keys.

Does that mean I can't join your gang? :oNot necessarily, but you would definitely need to wear the Ceremonial Pink Tutu a lot longer than the rest of us did.|||Well, there is a crucial difference. The row_number of a row in SQL 2005 can change, but the rownum in oracle can not, as it is stored with the data itself. Yes - it is determined by its own little order by clause so it isn't totally naughty. I'm not really terribly up on these things but I think it is in the SQL99 standard... maybe.|||Not necessarily, but you would definitely need to wear the Ceremonial Pink Tutu a lot longer than the rest of us did.Yay! And there was me thinking there might be a catch.|||Not necessarily, but you would definitely need to wear the Ceremonial Pink Tutu a lot longer than the rest of us did.
Nobody told me I was allowed to take this damn thing off!

No comments:

Post a Comment