How can i reterive the last 10 or 20 records. is there any other way except using select top 10 from table order by id desc
No, the 'order by' method is the simplest way to get the latest X records.
I reterived the first 5000 records and i haven't order them ASC and checked for some thing, the MSSQL have returned me un sorted list, i.e. the ID are random, and now if u use top 2000 order by desc. it will probably return me the records that I have previously worked on.
I don't understand what you mean.
select that 5000 records (not ASC) again. save them to temprary table. then get 2000 records order by desc. control them not to be same with 5000 record.
you have no other chance :-)
it will be tecrube for you :-)