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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-11-07 : 09:25:06
|
| Sean writes "When importing data from a *.dat file the data is often imported out of the order that it is in the file. Is there a way I can ensure the data comes in the same order that it is in the file?The file is a flat .dat file which is carat (^) delimited.Thanks in advance,Sean M BradleyDatabase AdministratorDaticon" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2002-11-07 : 09:59:43
|
| How do you know what order the data was imported in?Data in tables has no intrinsic orderIf you put an identity on the table then commit every record insert then it should be in the import order.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
daticondba
Starting Member
2 Posts |
Posted - 2002-11-12 : 08:21:29
|
| We know the order since it is in a flat file, with delimiters. We can open the file in Notepad and look at it. |
 |
|
|
mr_mist
Grunnio
1870 Posts |
Posted - 2002-11-12 : 09:08:50
|
quote: We know the order since it is in a flat file, with delimiters. We can open the file in Notepad and look at it.
What nr means (I think) is that, whilst the (text) file may be in a certain order, there is no concept of an order to the data once it has been moved from there into SQL Server. As in, if you select * from atable and then do that same statement again, there's no guarantee that the data will come out in the same order each time. |
 |
|
|
|
|
|