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)
 tab seperated file into sql server 7.0

Author  Topic 

cjmain
Starting Member

4 Posts

Posted - 2006-11-23 : 06:46:34
Here is a puzzeler for you,

I have a tab seperated file from a 3rd party that I am trying to load.

The file normally has 17 Columns in the data rows, however there is also a header which only has 3 columns and a footer that only has 1.

When I load in a data file it normally works fine except for the occasions when there are no data rows just a header and a footer where, where I get an error saying 'Column name 'Col004' was not found'

I understand why this is happening but is there any way of getting it to load the header and footer anyway?

Thanks

Chris

cjmain
Starting Member

4 Posts

Posted - 2006-11-23 : 06:49:31
Sorry I mean sql server 2000 (8.0) not 7.0
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-11-23 : 06:51:20
Which tool you are using to upload the file? BCP? DTS?

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

cjmain
Starting Member

4 Posts

Posted - 2006-11-24 : 05:50:05
I can use either but had more success with dts as when there is data rows it does load everything, header and footers and data. But with bcp it rejects the header and footers. I need to load the header and footers as the automated process that I am developing will check the processing date in the header and the row count in the footer.

thanks

Chris
Go to Top of Page

cjmain
Starting Member

4 Posts

Posted - 2006-11-27 : 06:42:19
I have managed to fix this myself.

What I did is after the transformation I had two branches an 'on completion' (not 'on success' this didn't work) and 'on failure'. On the on failure branch I did the tranformation again but with a new mapping using only the three columns available in the header, once the failure branch is complete it has a on success link back into the next dts file load step. The on completion branch of the original load goes to the next file load.
Go to Top of Page
   

- Advertisement -