• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

Display the actual row the record is saved in SQL 2000

I guess this is a two part question:

1. I would to display the actual row the records are stored in the table

2. Is there a way I can use Select to display a record by just calling the actual row number the record is saved in?
0
rayluvs
Asked:
rayluvs
  • 3
  • 2
  • 2
3 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
can you explan the big picture, please?
I am not to sure to understand what you are asking for?
0
 
rayluvsAuthor Commented:
Ok.

I notice that in SQL when creating a table, there is no "row number" column included, which I understand it would be useless if included.

Ok, to further explain my question: if I create a Table with 3 columns: PatienID, PatienName and PatiendDiagnostics, I would have a SQL table structure of 3 columns.  Finally we populate, import or data entry to this table 99,999 patients.

What I would like to know if SQL does have a row number or record number value stored as it saves data.  And I would like to know if we can display that row number within a Select statement next to each line it displays.








0
 
OriNetworksCommented:
If I understand correctly, you can return the identity of the inserted row by selecting
SELECT @@IDENTITY
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
OriNetworksCommented:
I just read your last post after I sent mine. It sounds like you are looking for a primary key identity column. You may want to insert a new row with datatype int and set the identity property to true
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
no, sql server 2000 does not have a "row number".

to store a sequential value for inserted rows, you would use a INT/IDENTITY field.
after the insert, you use SCOPE_IDENTITY()   [@@identity is only to be used in sql7] in the same session to retrieve the value generated by the insert.

other than that, you should not really need a "row number". for ranking, as from sql 2005, you have the ROW_NUMBER() function, among others...
0
 
rayluvsAuthor Commented:
Understood, SQL does not store this value.  With methods above in changing one of the columns types or storing sequential values, I can't use it since the table I want to display row-number is already being use for quite sometime; no re-restructure can be done.

Let me put the question this way:

Is there a way that after an INSERT I can recall that record location within the table without querying any of its columns? Some sort of SQL internal function that can display its location?


0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
short answer: no.

long answer: well, yes. you could query the system to to get the table's data block addresses, and dump those data pages hex data, and try to find the data your are looking for.
but I doubt this is anything you really are looking for, as that is only for dba to fix hard-core issues (like corrupt data pages, or investigating performance issues.)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now