dbTalk Databases Forums  

Loading delimited text file

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


Discuss Loading delimited text file in the microsoft.public.sqlserver.dts forum.



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

Default Loading delimited text file - 01-19-2005 , 04:04 AM






G'day,
I've created a data transformation task to load a delimited text file into a
SQL sever table. Some of the columns of data which have a FK constraint can
have NULL values. This shouldn't be a problem however I'm getting errors on
those records with 'NULL' values. The source file is comma separated and
uses single quotes as the text qualifiers. I've now found that when I use
the text file properties dialogue I can see that blank date and number
fields in the text file (that aren't enclosed in quotes) are being
interpreted as NULL, but empty text fields with '' are NOT being interpreted
as NULLS. I can temporarily get around this problem by leaving the text
qualifiers out of the source file but I'd prefer to leave them in. The
source file is being generated by Crystal Reports.

Can anyone shed any light on this? I would have thought that '' should be
interpreted at NULL.

Thanks.

cheers
peterDavey
Austin Health
Melbourne



Reply With Quote
  #2  
Old   
Francesco Anti
 
Posts: n/a

Default Re: Loading delimited text file - 01-19-2005 , 09:38 AM






Try to use an ActiveX transformation script to transform blank values into
null.

Francesco Anti

"peterDavey" <peter.davey (AT) austin (DOT) org.au> wrote

Quote:
G'day,
I've created a data transformation task to load a delimited text file into
a
SQL sever table. Some of the columns of data which have a FK constraint
can
have NULL values. This shouldn't be a problem however I'm getting errors
on
those records with 'NULL' values. The source file is comma separated and
uses single quotes as the text qualifiers. I've now found that when I use
the text file properties dialogue I can see that blank date and number
fields in the text file (that aren't enclosed in quotes) are being
interpreted as NULL, but empty text fields with '' are NOT being
interpreted
as NULLS. I can temporarily get around this problem by leaving the text
qualifiers out of the source file but I'd prefer to leave them in. The
source file is being generated by Crystal Reports.

Can anyone shed any light on this? I would have thought that '' should be
interpreted at NULL.

Thanks.

cheers
peterDavey
Austin Health
Melbourne





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

Default Re: Loading delimited text file - 01-19-2005 , 04:00 PM



Francesco,
Thanks for the reply. I was hoping to avoid creating individual
transformations for each column (for performance and maintainability
reasons) and was looking for a global setting that might do the job.
cheers
peterDavey

"Francesco Anti" <fanti @ sicosbt.it> wrote

Quote:
Try to use an ActiveX transformation script to transform blank values into
null.

Francesco Anti

"peterDavey" <peter.davey (AT) austin (DOT) org.au> wrote in message
news:%23hhNP4g$EHA.2804 (AT) TK2MSFTNGP15 (DOT) phx.gbl...
G'day,
I've created a data transformation task to load a delimited text file
into
a
SQL sever table. Some of the columns of data which have a FK constraint
can
have NULL values. This shouldn't be a problem however I'm getting
errors
on
those records with 'NULL' values. The source file is comma separated
and
uses single quotes as the text qualifiers. I've now found that when I
use
the text file properties dialogue I can see that blank date and number
fields in the text file (that aren't enclosed in quotes) are being
interpreted as NULL, but empty text fields with '' are NOT being
interpreted
as NULLS. I can temporarily get around this problem by leaving the text
qualifiers out of the source file but I'd prefer to leave them in. The
source file is being generated by Crystal Reports.

Can anyone shed any light on this? I would have thought that '' should
be
interpreted at NULL.

Thanks.

cheers
peterDavey
Austin Health
Melbourne







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.