Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Peter01
Starting Member
16 Posts |
Posted - 2014-08-13 : 20:06:36
|
Hello,I am trying to BCP IN a flat file that must maintain the sequence that is within the file. For an example, row 1 in the flat file must be in row 1 of the table.At present BCP is changing the order.Can I do this?Thanks,Peter |
|
Ifor
Aged Yak Warrior
700 Posts |
Posted - 2014-08-14 : 07:00:57
|
A relation (table, view etc) is an UNORDERED set.If you need the order of the flat file you will have to add a LineNumber column to the source. You will then be able to get the original order in SQL by:SELECT *FROM ImportedTableORDER BY LineNumber |
|
|
Peter01
Starting Member
16 Posts |
Posted - 2014-08-16 : 18:01:14
|
Hi,I have added a line number to the source.many thanks,Peter |
|
|
|
|
|