Thursday, October 31, 2013

ROWID equivalent in Microsoft SQL*Server

The last few months I've been having to work with Microsoft SQL*Server 2008 R2 for a project I'm on.  I'm not finding it fun for a variety of reasons, including that it doesn't seem as capable as I recall Oracle being and that the source data I'm having to work with is very, very dirty.

One of the complicating factors is often there will be exactly, or almost exactly, duplicate rows when each row should be unique.  Obviously I need to have something to uniquely identify the rows for the delete so looked for an equivalent of ROWID (the pseudo-column in Oracle that uniquely identifies a row).  I found a page that talks about this.  The pseudo column is %%physloc%%.