dbTalk Databases Forums  

Tab-delimited file import creates NULL values

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


Discuss Tab-delimited file import creates NULL values in the microsoft.public.sqlserver.dts forum.



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

Default Tab-delimited file import creates NULL values - 08-18-2004 , 11:07 AM






Hi,

I have a tab delimited file I'm trying to import into sql server. My table doesn't allow null values. My problem is, the source text-file looks at two tabs together and treats it as a null value. I'd rather not have this if possible, but have an empty string. Is there any way to set DTS so it interprets <tab><tab> as an empty string? I realize I can write an activex script to check for null values during the transformation, but that seems like that shouldn't have to be done.

Thanks for any help,
--Michael

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

Default Re: Tab-delimited file import creates NULL values - 08-18-2004 , 01:41 PM






Problem is without getting into Active Script Transforms then the Text File
driver is not very flexible.

I _ALWAYS_ import to a staging table before moving to my real table and then
use TSQL to do the move into the real table.

The speed of BULK INSERT is favourable and I have never been constrained by
the extra step

--
--

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


"Raterus" <moc.liamtoh (AT) suretar (DOT) reverse> wrote

Hi,

I have a tab delimited file I'm trying to import into sql server. My table
doesn't allow null values. My problem is, the source text-file looks at two
tabs together and treats it as a null value. I'd rather not have this if
possible, but have an empty string. Is there any way to set DTS so it
interprets <tab><tab> as an empty string? I realize I can write an activex
script to check for null values during the transformation, but that seems
like that shouldn't have to be done.

Thanks for any help,
--Michael



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

Default Re: Tab-delimited file import creates NULL values - 08-18-2004 , 03:52 PM



thanks!

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

Quote:
Problem is without getting into Active Script Transforms then the Text File
driver is not very flexible.

I _ALWAYS_ import to a staging table before moving to my real table and then
use TSQL to do the move into the real table.

The speed of BULK INSERT is favourable and I have never been constrained by
the extra step

--
--

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


"Raterus" <moc.liamtoh (AT) suretar (DOT) reverse> wrote in message
news:e7Js$1ThEHA.3236 (AT) TK2MSFTNGP10 (DOT) phx.gbl...
Hi,

I have a tab delimited file I'm trying to import into sql server. My table
doesn't allow null values. My problem is, the source text-file looks at two
tabs together and treats it as a null value. I'd rather not have this if
possible, but have an empty string. Is there any way to set DTS so it
interprets <tab><tab> as an empty string? I realize I can write an activex
script to check for null values during the transformation, but that seems
like that shouldn't have to be done.

Thanks for any help,
--Michael



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.