Friday, February 24, 2012

How to know the order of entries in a table

For example some data has entered into a table in a random manner i.e the pk filed value is not in a serial fashion.Is there any table or index that holds the entries of rows into a particular table as entered .

i.e
'some_table' has data like this

3,entry3
2,entry2
4,entry4
1,entry1

I want some DB table or Index that holds data like this about above 'some_table'

row_id ... ... ...
1
2
3
4

here 1 refers to entry of the first column in 'some_table' i.e 3,entry3
and so on...Hi

Please reread my first post in here:
http://www.dbforums.com/showthread.php?t=1620041

There is no order. If you need to know the order that data was inserted then you need to set something up yourself - use an identity column or a timestamp with a GETDATE() default value. Note that the second option will result in "ties" if you insert sets of data.|||Thanks for your help...

No comments:

Post a Comment