SSIS LookUp is not dealing with NULLs like the docs say it should

后端 未结 4 1996
难免孤独
难免孤独 2020-12-04 01:41

I have an SSIS data flow that uses a lookup. Sometimes the value to be looked up (in my stream, not in the lookup table) is null.

The MSDN Docs say:

4条回答
  •  误落风尘
    2020-12-04 02:13

    I know this is a late answer, but for anyone searching on this like I was, I found this to be the simplest answer:

    In the lookup connection, use a SQL query to retrieve your data and add UNION SELECT NULL, NULL to the bottom.

    For example:

    SELECT CarId, CarName FROM Cars 
    UNION SELECT NULL, NULL
    

    Preview will show an additional row of CarId = Null and CarName = Null that will be available in the lookpup.

提交回复
热议问题