dbTalk Databases Forums  

End-of-line problem

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss End-of-line problem in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Beema
 
Posts: n/a

Default End-of-line problem - 07-22-2004 , 11:22 AM






Hi

I'm importing 40 text files, with headers and delimited by Vertical Bar into
SQL tables with exact column matchings.
Initially the files has {CR}{LF} as the end-of-row delimeter, but this has
been changed to just {LF}

I am having trouble with just 6 of the 40 files, and there is nothing
different from them to the rest.

The last column is failing with "Conversion invalid for datatypes on column
pair xx"

If I ignore the last column it goes through OK.


When I preview the contents of the text file in the connection properties,
the last column shows up as NULL, when I preview in the DTS Transform data,
there looks to be a character there, but I don't know what it is....

Any help would be much appreciated.

Ben




Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: End-of-line problem - 07-22-2004 , 11:22 AM






Have you run it through a Hex Editor?

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
Hi

I'm importing 40 text files, with headers and delimited by Vertical Bar
into
SQL tables with exact column matchings.
Initially the files has {CR}{LF} as the end-of-row delimeter, but this has
been changed to just {LF}

I am having trouble with just 6 of the 40 files, and there is nothing
different from them to the rest.

The last column is failing with "Conversion invalid for datatypes on
column
pair xx"

If I ignore the last column it goes through OK.


When I preview the contents of the text file in the connection properties,
the last column shows up as NULL, when I preview in the DTS Transform
data,
there looks to be a character there, but I don't know what it is....

Any help would be much appreciated.

Ben






Reply With Quote
  #3  
Old   
Beema
 
Posts: n/a

Default Re: End-of-line problem - 07-22-2004 , 11:39 AM



No, I don't know enough about that to do it.


I've done a test which may shed some light..

The destination column was an integer, I changed to varchar, an dthe file
imported fine. In the text file there only values were 1 and blank (ie NULL)

When I did the following query I got interesting output...

select distinct 'AA' + TheColumn + 'BB' from TheTable

The result I got was:

TheColumn
------------
AA
BB
AABB
NULL
1


I am confused about how this happened??





"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote

Quote:
Have you run it through a Hex Editor?

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:eQZ$tfAcEHA.1000 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Hi

I'm importing 40 text files, with headers and delimited by Vertical Bar
into
SQL tables with exact column matchings.
Initially the files has {CR}{LF} as the end-of-row delimeter, but this
has
been changed to just {LF}

I am having trouble with just 6 of the 40 files, and there is nothing
different from them to the rest.

The last column is failing with "Conversion invalid for datatypes on
column
pair xx"

If I ignore the last column it goes through OK.


When I preview the contents of the text file in the connection
properties,
the last column shows up as NULL, when I preview in the DTS Transform
data,
there looks to be a character there, but I don't know what it is....

Any help would be much appreciated.

Ben








Reply With Quote
  #4  
Old   
Beema
 
Posts: n/a

Default Re: End-of-line problem - 07-22-2004 , 11:44 AM



So I think the end-of-line characters may be inconsistent??

Possibly some ending in {LF} and some ending in {CR} ??




"Beema" <none (AT) supplied (DOT) com> wrote

Quote:
No, I don't know enough about that to do it.


I've done a test which may shed some light..

The destination column was an integer, I changed to varchar, an dthe file
imported fine. In the text file there only values were 1 and blank (ie
NULL)

When I did the following query I got interesting output...

select distinct 'AA' + TheColumn + 'BB' from TheTable

The result I got was:

TheColumn
------------
AA
BB
AABB
NULL
1


I am confused about how this happened??





"Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message
news:epGjvgAcEHA.2816 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
Have you run it through a Hex Editor?

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.konesans.com - Consultancy from the people who know


"Beema" <none (AT) supplied (DOT) com> wrote in message
news:eQZ$tfAcEHA.1000 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Hi

I'm importing 40 text files, with headers and delimited by Vertical
Bar
into
SQL tables with exact column matchings.
Initially the files has {CR}{LF} as the end-of-row delimeter, but this
has
been changed to just {LF}

I am having trouble with just 6 of the 40 files, and there is nothing
different from them to the rest.

The last column is failing with "Conversion invalid for datatypes on
column
pair xx"

If I ignore the last column it goes through OK.


When I preview the contents of the text file in the connection
properties,
the last column shows up as NULL, when I preview in the DTS Transform
data,
there looks to be a character there, but I don't know what it is....

Any help would be much appreciated.

Ben










Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.