The way I have done this is to include an identity column in the table
definition, then ingore that column when importing the data using DTS.
The identity column is in the sequence of the incoming file. You
would then use an ORDER by when exporting the data back out - but
exclude the identity column from the export.
Roy Harvey
Beacon Falls, CT
On 6 Jul 2006 07:05:35 -0700, "sherdian" <sheridan.zhu@gmail.com>
[quoted text, click to view] wrote:
>I do this in both importing and exporting. But it was during the
>importing process that the sequence was messed up. ORDER BY will not
>work because my original file is not sorted is any way. Any
>suggestions?
>
>Thanks,
>Sheridan
>
>Allan Mitchell wrote:
>> Hello sheridan.zhu@gmail.com,
>>
>> A way to guarantee ordering is to use an ORDER BY clause.
>>
>> Are you doing this in your export?
>>
>> Allan
>>
>>
>>
>> > I'm using DTS to process a text file in SQL Server and then exporting
>> > it back out as a text file.
>> >
>> > I first create a table in SQL Server, then import the text file into
>> > that table. I need the file in its orginal sequence as it goes in and
>> > out of the SEQ Server. However, sometimes, the file is not
>> > maintaining
>> > its sequence, in which case I will have to hit Transform Data Task
>> > twice (double import the file) and then run the whole package again.
>> > It works every time!
>> > Why does this happen? Is there a way not to manually intervene?
>> >
>> > Thanks in advance.
>> >
>> > Sheridan