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 FTP gets file in an incorrect format

Author  Topic 

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-03-24 : 06:59:22
I did use an FTP batch file command to retrieve a text file from a Unix box. A DTS job would then pick up that file and import it into a table. Unfortunately, if the Unix box failed to create the text file, an empty file would be ftped over instead and as a result the dts job would fail.

So I opted to use the FTP task within DTS as this does not produce an empty file should the Unix job fail.

For some wierd reason the DTS FTP task returns data within the text with extra spaces and a wierd character (a small rectangle), however the batch file returns it correctly.

Any guesses why this is happening, as SQL Server has difficulty locating the demlimiter.

A later added note: The inconsistancy only appears if both files are opened using notepad, but are identical if opened with Wordpad!


Thanks

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-03-24 : 07:22:51
You have rich text characters in there, wordpad can deal with them, notepad can't..
Go to Top of Page

drewsalem
Constraint Violating Yak Guru

304 Posts

Posted - 2006-03-24 : 08:02:37
Right, so the batch command must be automatically striping the file of these rich text characters but not the FTP DTS task. Is there a way to have the DTS data transfer engine deal with that?

Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2006-03-24 : 08:21:30
I don't think so, but you could always look for it, if you push this into a table, look for the character and do a select ascii(substring(<fieldname>,positionofchar,1) to find out what character it is, then either handle it in your code or remove it from your file before doing what you need..
Go to Top of Page
   

- Advertisement -