home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / database / sybase / 345 < prev    next >
Encoding:
Text File  |  1992-11-18  |  2.3 KB  |  54 lines

  1. Newsgroups: comp.databases.sybase
  2. Path: sparky!uunet!csfb1!lhall
  3. From: lhall@csfb1.fir.fbc.com (Lawrence Hall)
  4. Subject: RE: Order of record when inserting 
  5. Message-ID: <Bxx2G3.I5w@csfb1.fir.fbc.com>
  6. Sender: news@csfb1.fir.fbc.com (Usenet News Account)
  7. Reply-To: uunet!csfb1!lhall
  8. Organization: First Boston Corporation
  9. Date: Wed, 18 Nov 1992 14:48:03 GMT
  10. Lines: 42
  11.  
  12. Kevin Dombroski writes :
  13.  
  14. [ Is there any guarantee of the order of records after doing several inserts
  15. [ to table, and then doing a "select *" from the table (ie., no "order by")?
  16. [ I've always understood that there can be no guarantee, but I can't find any-
  17. [ thing in the manuals to support/dispute this, and I'm waiting for a call back
  18. [ from Sybase Tech Support. For some reason, I feel like I'll get the answer here
  19. [ faster...
  20. [ I'm dealing with data coming from an IBM mainframe, and the arrangement of
  21. [ the returned data must be preserved (I know, I know...at least it's not a
  22. [ punch card system :-). After stuffing it into a temp table, it doesn't
  23. [ appear to preserve the order. Is there some way this can be accomplished?
  24. [                 KevinD
  25.  
  26. I have found that the order seems to be preserved when using Fast BCP to insert
  27. data, but not always on inserts or Slow BCP's.  However - I prefer that users 
  28. at our site do not rely on the order of records since there is no guarantee of 
  29. the order.  If the records come back in a certain order, and the application 
  30. rely's on this, then the app will have problems if the clustered index is 
  31. changed, if the data is unloaded and re-loaded or when we change DBMS versions. 
  32.  
  33. I tell our programmers to use an ORDER BY whenever they need a specific order. 
  34. In the case you speak of, it might be necessary to use a timestamp column on 
  35. the table and use that for the ORDER BY.  
  36.  
  37. The only time that we rely on the order of inserted records is when we are
  38. doing a fast BCP of a large table and want to use the 'with sorted data' option
  39. when creating the clustered index. 
  40.  
  41. " " " Lawrence
  42.  
  43.  
  44. ----------------------------------------------------------------------------
  45. Lawrence E. Hall
  46. First Boston Corp.
  47. 5 World Trade Center 9th Floor                    uunet!csfb1!phantom!lhall
  48. NYC, NY  10048                                    lhall@csfb1.fir.fbc.com
  49. ----------------------------------------------------------------------------
  50. The Secretary will disavow all knowledge. 
  51.