Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
jchrist79
Starting Member
7 Posts |
Posted - 2010-07-21 : 21:26:56
|
Hi all,I'm trying to import a '|' delimited flat file to a SQL server 2005 table using a data flow task in SSIS. I've got a flat file source which feeds into a OLE DB destination. The fields I am importing include char(1) columns, varchar columns and numeric columns. My OLE DB destination is configured so that 'Keep Nulls' is true and I'm using the 'Table or view - fast load' Data access mode. What I'm finding is that varchar fields that have no data in the import file are appearing as empty string instead of NULL in the table after import. Also, numeric fields (i.e. numeric(3, 0)), with no data in the import file, are appearing as 0 instead of NULL in the table column. What do I need to do to get NULLS when there is no data for a particular column? By no data I mean the record looks something like'this field has data||previous field had no data|34||'So the first, third and fourth columns have data but the second and fifth dont.In my flat file connection manager I have defined numeric columns with the numeric[DT_NUMERIC] data type and varchar columns with the string[DT_STR] data type.The columns I am trying to import to are all nullable and have no default values.My environment is SQL Server 2005 on a 64bit server running windows server 2008. Im using Visual Studio 2005 to develop the package.--------------------Cheers,James |
|
jchrist79
Starting Member
7 Posts |
Posted - 2010-07-22 : 20:13:03
|
Ok worked out what I was doing wrong. I needed to set the property "RetainNulls" to true for the Flat File Source in the data flow. So this needs to be set as well as the FastLoadKeepNulls property in the OLE DB destination.--------------------Cheers,James |
|
|
|
|
|