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.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DTS importing data out of order

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 Bradley
Database Administrator
Daticon"

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 order

If 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.
Go to Top of Page

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.

Go to Top of Page

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.

Go to Top of Page
   

- Advertisement -