SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


RowID in Sql Server


RowID in Sql Server

Author
Message
AJ07
AJ07
SSC Veteran
SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)SSC Veteran (222 reputation)

Group: General Forum Members
Points: 222 Visits: 198
Hi,
Is anybody know that do we have anything like Oracle's inbuilt primary key ROWID which is also accessible to database developer.

I searched for it but could not get the satisfactory answer.


Thanks,
Smile
Andras Belokosztolszki
Andras Belokosztolszki
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2945 Visits: 1585
ajaymistry_07 (8/8/2008)
Hi,
Is anybody know that do we have anything like Oracle's inbuilt primary key ROWID which is also accessible to database developer.

I searched for it but could not get the satisfactory answer.


Thanks,
Smile


There isn't one that you can access from T-SQL. You should set up a PK yourself. If you run into a situation where there isn't one on a table, you may still be able to access individual items on SQL Server 2005 and 2008 (just search the forums for removing duplicate rows)
Regards,
Andras



Andras Belokosztolszki, MCPD, PhD
GoldenGate Software
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
SSCertifiable
SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)SSCertifiable (7.2K reputation)

Group: General Forum Members
Points: 7235 Visits: 4639
... like Oracle's inbuilt primary key ROWID


Oracle's ROWID is not a PK. ROWID is a unique row identifier, nothing else, nothing more.

_____________________________________
Pablo (Paul) Berzukov

Author of Understanding Database Administration available at Amazon and other bookstores.

Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
upalsen
upalsen
SSC Rookie
SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)SSC Rookie (29 reputation)

Group: General Forum Members
Points: 29 Visits: 27
ROWIDs represent the physical location of a record/row.
And most important part is ROWID can change if the row is moved as in index organized or partitioned tables.
Erich Brinker
Erich Brinker
Old Hand
Old Hand (387 reputation)Old Hand (387 reputation)Old Hand (387 reputation)Old Hand (387 reputation)Old Hand (387 reputation)Old Hand (387 reputation)Old Hand (387 reputation)Old Hand (387 reputation)

Group: General Forum Members
Points: 387 Visits: 633
If you are using SQL Server 2005 or 2008 you can take advantage of the Row_number function. If you are in 2000, you can use an identity column
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search