April 29, 2003 at 3:19 pm
Any way to force BCP or Bulk Insert to import a text file in exact original row order?
BCP and bulk insert and DTS all scramble the row order.
Source is a tab-delimited text file. No key, contents are not usable for the ORDER hint. But order is important, it has headings, subheadings, subtotals, totals that will be utilized.
April 29, 2003 at 6:41 pm
Has clustered key defined on some columns in your destination table?
April 30, 2003 at 9:35 am
Actually it should import in row order if there is no clustered index. Are you expecting to "select" the data and get it back in this order? There is no guarentee of this. If this is what you want, add an identity column to your table, import into it and select by the identity column.
Steve Jones
April 30, 2003 at 9:18 pm
Source file has 4 columns, destination table has 5 (4 plus identity primary key)
Destination is dropped and created on each attempt, so no weird carryover or gaps in the identity column
select * from table order by identity
results in a scrambled version of the original
April 30, 2003 at 9:24 pm
Forgot to mention - no indexes on imported columns
Identity is primary key clustered
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply