SSIS Lookup by NVarChar(Max) Column

前端 未结 2 1986
一生所求
一生所求 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.

提交回复
热议问题