Stephen Russell wrote: > ---------------------------------------------------------------------- > > Is OrderNo int or nchar() ? Hummm clastOrderNumber I am guessing that > it is not a good index candidate for what your doing. > > have you checked the statistics? > > Here is a good overview with specific details on Index creation ins SQL > Server: > <http://www.sql-server-performance.com/tips/optimizing_indexes_general_p1.aspx> > > I bet the idea of previous <-> next is a hold over from years gone by. > > why not get a record set back of 10-50 rows of the real key for the > table Orders as well as the display of the Order Number. > >
I bet Steve's right that it's a holdover from yesteryear. For no good reason, many feel better with VCR buttons even though in most apps, they're not practical. I'd craft code that would grab the next highest/lowest PK (assuming integer/numeric keys) by itself (e.g. SELECT TOP 1 iid FROM MYTABLE WHERE iid>tiCurrentValue) and then use that specific key in your real data grabbing query (SELECT <list of fields...avoid * if you can to avoid pulling data you don't need> FROM MYTABLE WHERE iid = tiKeyYouGotFromPreviousSQL). _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.