dbTalk Databases Forums  

Bulk Insert - How to represent nulls in .txt input file?

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


Discuss Bulk Insert - How to represent nulls in .txt input file? in the microsoft.public.sqlserver.dts forum.



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

Default Bulk Insert - How to represent nulls in .txt input file? - 08-25-2004 , 11:12 AM






I have a table that I'm loading via .txt file input.

One of the columns has a datatype of datetime. It does allow nulls
which I've checked by simply adding 1 record via enterprise manager
with no value in the field.

When I execute the DTS package, I get "conversion error: Conversion
invalid for datatypes on ...."

This is a comma delimited file with Quotes (") surrounding the values.

I've tried no values ,"",

Blank ," ",

/N ,"/N"

<NULL> ,"<NULL>"

and all of them give me the same conversion error. I'm about to give
up and just pass some bogus date off in the future but there must be a
way to pass a null to a datetime field that allows nulls.

Any help for this newbie appreciated.

Reply With Quote
  #2  
Old   
Sean
 
Posts: n/a

Default Re: Bulk Insert - How to represent nulls in .txt input file? - 08-25-2004 , 11:24 AM






On Wed, 25 Aug 2004 12:12:22 -0400, Sean <none> wrote:

Quote:
I have a table that I'm loading via .txt file input.

One of the columns has a datatype of datetime. It does allow nulls
which I've checked by simply adding 1 record via enterprise manager
with no value in the field.

When I execute the DTS package, I get "conversion error: Conversion
invalid for datatypes on ...."

This is a comma delimited file with Quotes (") surrounding the values.

I've tried no values ,"",

Blank ," ",

/N ,"/N"

NULL> ,"<NULL>"

and all of them give me the same conversion error. I'm about to give
up and just pass some bogus date off in the future but there must be a
way to pass a null to a datetime field that allows nulls.

Any help for this newbie appreciated.

Answering my own question...

I just tried ,, (no quotes) and that worked.

Sean


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.