SSIS overwriting table default bindings with NULL values

  • Morning All,

    I have a simple data flow task set up to import from a flat file destination into a staging table in sql server. As always I have a number of standard fields on the staging tables that contain default bindings. To explain my issue we'll focus on just the one "InsertedDate". This field has a default binding of CURRENT_TIMESTAMP or GetDate().

    I have no requirement for SSIS to get involved with this field at any point I just want to know when the record was added. Normally I have no problems simply mapping my data source fields to the other fields in the table and running successfully however I have one key difference in this package:

    DataSource> Advanced Editor > Component Properties > RetainNulls = True

    I have set this to true to avoid SSIS cast failures where blanks are supplied in the flat file source that are destined for date or decimal destinations.

    Problem is SSIS creates a reference to the field InsertedDate in the external columns list regardless of if I'm sending data to it or not and it is (I believe) sending a NULL into the table overwriting the default binding because it has no source in the flat file.

    Under the advanced editor of my OLE DB Destination I have tried removing these column references but they are replaced by SSIS as soon as i leave the advanced editor.

    I know I have options - use derived columns in SSIS instead of default bindings in my table etc I just think I shouldn't need to so was wandering if I'm missing anything?

    Thanks

    Chris

  • SOLVED!

    OLE DB DESTINATION > Advanced Editor > Component Properties > Fast Load Keep Nulls > Set to True

    This will allow fields in the destination table to keep defaults when a NULL is passed from the source.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply