July 9, 2009 at 9:21 am
Hi all,
I have the table with follwing structure
ID( Forgein key ),
UpdatedTime DateTime,
.....
I inserted two records with two same datetime and other parameters differs
but when i am selecting based on Datetime field it does not displays in the order which i have inserted(duplicate datetime) .
I Applied index for ID and UpdatedTime .How do i get the order in which i inserted and also by [DateTime]?
Thanks in Advance
July 9, 2009 at 12:18 pm
Unless you have some kind of incrementing column like an Identity column or an Inserted Date then there is no way to know when a row was inserted or to return it in that order. In theory if you have heap and return all the rows or have table scan you would get the data in inserted order, but even that isn't guaranteed in multi-processor systems because of parallelism.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
July 9, 2009 at 12:29 pm
Sorry, duplicate post, try this thread instead.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply