SSIS Lookup by NVarChar(Max) Column

前端 未结 2 1953
一生所求
一生所求 2021-01-23 01:38

I want to get id from target table by lookup with NVarChar(Max) column in target table and NVarChar(20) column in source table. But raise error Cannot map the lookup colum

相关标签:
2条回答
  • 2021-01-23 02:03

    In your Lookup transformation, you need to cast the blob (nvarchar(max)) to a non-blob type. In this case, I would assume you need to cast it to nvarchar(20).

    You will need to write a query in the lookup transformation and not just select the table.

    Assuming the lookup table looks like

    LookupTable
    --------------
    Column0 int
    Column1 nvarchar(max)
    Column2 nvarchar(500)
    

    You query would look like

    SELECT 
        L.Column0
    ,   CAST(L.Column1 AS nvarchar(20)) AS Column1
    ,   L.Column2 
    FROM
        dbo.LookupTable L
    

    You should now be able to perform a lookup on that column.

    0 讨论(0)
  • 2021-01-23 02:21

    you cant:

    The join can be a composite join, which means that you can join multiple columns in the transformation input to columns in the reference dataset. The transformation supports join columns with any data type, except for DT_R4, DT_R8, DT_TEXT, DT_NTEXT, or DT_IMAGE

    are you sure you are using the component correctly? You usually lookup by ID to get the text. Can you give more details?

    0 讨论(0)
提交回复
热议问题