Link to home
Start Free TrialLog in
Avatar of g_johnson
g_johnsonFlag for United States of America

asked on

importing null value into "real" datatype column via dts -- MS Sql Server 2000

MS SQL Server 2000

I have a tab-delimited text file with a header row, the last 3 columns of which are of the data type "real".  The last column needs to be imported as null.  I am trying to import this file through DTS.

A row in the tab-delimited text file looks like this:

info <tab> info <tab> 0 <tab> 0 <tab> null

I am getting an error during the DTS process:

"Conversion invalid for datatypes on column pair 5 (source column 'nDistance' (DBTYPE_STR),destination column 'nDistance' (DBTYPE_R4)).

I don't understand why it's seeing the last column as a string.

How can I solve this?
ASKER CERTIFIED SOLUTION
Avatar of D B
D B
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Chris Mangus
Since it is a text file DTS / SSIS will interpret NULL as a literal string.  You can use the conversion scheme that dbbishop talked about or you could modify the text file to replace NULL with a zero, if that is appropriate.