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)
 Ragged Right CSV

Author  Topic 

caffeine200
Starting Member

3 Posts

Posted - 2006-09-11 : 04:32:19
I'm trying to import a file with the following data:

19402,200608,899430014, 120.000, 122.040, 165.9
19402,200608,899499003, 28.000, 154.890, 210.6
19402,200608,899511006, 10.000, 51.750, 70.3
21334,200509,099001001, 3.000, 0.000, 65.79,
21334,200509,099002001, 2.000, 0.000, 8.78,
21334,200509,099011001, 2.000, 0.000, 8.77,
21334,200509,406942001, 10.000, 1.740, 3.25,


As you can see above, some of the rows end with a comma and some don't. Is it possible to handle this effectively in DTS / SSIS using BULK INSERT or similar or should I write a VB app and read through files using the FileSystemObject?

Thanks for any help.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-09-11 : 06:06:00
It is. just use a format file.
here's some info:
http://weblogs.sqlteam.com/mladenp/articles/10631.aspx
http://weblogs.sqlteam.com/mladenp/archive/2006/07/22/10742.aspx

If you can use tablock option use bulk insert.



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -