Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

How to get rowid in sql server 2005 Expand / Collapse
Author
Message
Posted Friday, March 26, 2010 11:59 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, January 29, 2012 11:19 AM
Points: 9, Visits: 21
I want to get the rowid internally generated at table level in sql server. Because I need to perform some task according to the rowid.
Post #890948
Posted Friday, March 26, 2010 12:22 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, July 15, 2014 10:26 AM
Points: 823, Visits: 1,203
do you want to return a result with a row number as part of the output or do you want to grab a specific row, as in you want row 10 of the data set?

Dan

If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.
Post #890975
Posted Friday, March 26, 2010 12:24 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 10:02 PM
Points: 23,210, Visits: 31,892
nitinkumar_tss (3/26/2010)
I want to get the rowid internally generated at table level in sql server. Because I need to perform some task according to the rowid.


Unfortunately, there isn't an internally generated rowid at the table level in SQL Server.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #890977
Posted Friday, March 26, 2010 1:52 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 22, 2014 9:38 AM
Points: 1,525, Visits: 4,071
It seems like Oracle uses something like this that you can access, but unfortunately MS SQL does not. If you can give more details on your goal, it's possible we can suggest another way to do it.

Seth Phelabaum
Consistency is only a virtue if you're not a screwup.

Links: How to Post Sample Data :: Running Totals :: Tally Table :: Cross Tabs/Pivots :: String Concatenation
Post #891059
Posted Saturday, March 27, 2010 8:25 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, August 9, 2014 2:06 AM
Points: 127, Visits: 355
what kind of row id du you need.
If you need row id which is stored in your table then you can use table's identity value for the same
Post #891293
Posted Saturday, March 27, 2010 1:14 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Sunday, May 11, 2014 8:07 PM
Points: 891, Visits: 235
there is not rowid equivalent in SQL Server


Post #891332
Posted Sunday, March 28, 2010 2:00 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 10:59 AM
Points: 11,194, Visits: 11,135
Lynn Pettis (3/26/2010)
nitinkumar_tss (3/26/2010)
I want to get the rowid internally generated at table level in sql server. Because I need to perform some task according to the rowid.
Unfortunately, there isn't an internally generated rowid at the table level in SQL Server.

Well, technically there is, sort of, but it is undocumented and not intended for use by end users.




Paul White
SQL Server MVP
SQLblog.com
@SQL_Kiwi
Post #891408
Posted Sunday, March 28, 2010 6:22 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, August 13, 2014 6:36 AM
Points: 2,397, Visits: 3,405
Paul White NZ (3/28/2010)
[quote]Well, technically there is, sort of, but it is undocumented and not intended for use by end users.

+1 for that.
All records do have a "hidden" record identifier, when there is not primary key on the table. That's the way SQL Server distinguishes between two identical records.
Read more about what Kalen Delaney writes about this.



N 56°04'39.16"
E 12°55'05.25"
Post #891448
Posted Sunday, March 28, 2010 8:47 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 10:02 PM
Points: 23,210, Visits: 31,892
SwePeso (3/28/2010)
Paul White NZ (3/28/2010)
[quote]Well, technically there is, sort of, but it is undocumented and not intended for use by end users.

+1 for that.
All records do have a "hidden" record identifier, when there is not primary key on the table. That's the way SQL Server distinguishes between two identical records.
Read more about what Kalen Delaney writes about this.


Is it actually a row identifier, like this is row 10? Reason I ask is that is what most people are looking for when they are asking about an internal rowid. Is that what this individual is asking, not sure.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #891471
Posted Sunday, March 28, 2010 9:53 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 4:14 PM
Points: 42,747, Visits: 35,835
Lynn Pettis (3/28/2010)
Is it actually a row identifier, like this is row 10? Reason I ask is that is what most people are looking for when they are asking about an internal rowid. Is that what this individual is asking, not sure.


Think they're talking about the RID. Row Identifier, binary value, 8-byte combination of file id, page number and slot index. It's accessible on all tables (not just heaps), however it's likely to change whenever the clustered index is rebuilt (and, on SQL 2008, if the heap is ever rebuilt) because it's the physical location of the row.



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #891481
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse