Null values in package

sql test 60 Reputation points
2023-06-30T00:13:00.1766667+00:00

I've created a package with SSIS, contains flatfile as source and load the data to sql server table, however it could not keep the null values, please advice.

SQL Server Integration Services
0 comments No comments
{count} votes

Answer accepted by question author
  1. ZoeHui-MSFT 41,536 Reputation points
    2023-06-30T01:49:34.2466667+00:00

    Hi @sql test,

    Please first check if you have chosen allow nulls in your destination table.

    Secondly, you may set as below when configure the flat file source.

    User's image

    If these do not work, you may add a derived column transformation with the following expression to convert the blank/empty value to null.

    (DT_STR,50,1252)( TRIM(Col) == "" ? (DT_STR,50,1252)NULL (DT_STR,50,1252) : Col )
    

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.