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 Data Pump from csv file - 'variable' columns!

Author  Topic 

MarkyBoy666
Starting Member

14 Posts

Posted - 2005-04-12 : 05:06:20
I've been experiencing a problem with a DTS package I've designed, and was wondering if anyone else had had a similar problem.

Basically, I have a data pump task which takes an Excel-generated .csv file and transfers the data into a SQL table. Each .csv column is mapped to a column in the destination table using either a "copy unchanged" or date/time" transformation. OK so far.

However, I've noticed that if the .csv file happens to have only a few rows of data, and there is a blank field at the end of ALL the rows (e.g. let's say the last column is for 'Notes' but NONE of the rows have an entry for that column), this field is NOT marked by a comma separator - in effect, it "doesn't exist" and the file (if opened in a text editor) simply stops at the last populated field.

Obviously, the DTS sees this as a csv file with an 'incorrect number' of fields, and therefore with an invalid set of transformations (i.e. it sees that 'Col35' or whatever is meant to map to the 'Notes' field in the table, but as far as it's concerned the rows in the csv file stop at 'Col34').

Does anyone have any suggestions? I'm not really able to alter the csv file as I won't have control over that, and really need a way of somehow making the DTS ignore transformations for the last few columns if those columns appear not to exist.
   

- Advertisement -