SSIS is dropped in DT_WSTR without dropping, or so it seems

I am creating an SSIS 2008 package that reads data from an ASCII source file and writes it to a SQL Server 2008 database. BIDS complained of an implicit cast between the unicode and non-unicode data types, so I used a column handler to create the cast. It looks like this:

Derived Column Name | Derived Column | Expression | Data Type AccountName2 | Replace 'AName' | (DT_WSTR,100) AName | string [DT_STR] 

I still get the same error:

 Validation error. InsertAccountRecords: InsertAccountRecords: Columns "AccountName2" and "AName" cannot convert between unicode and non-unicode string data types. 

The error appears in the SQL Server Destination application, which makes me think that the problem is related to the data type in the derived column. I drop it from DT_STR to DT_WSTR, but the data type is still nominally DT_STR according to this, no?

I have googled around and I cannot find good answers to this question. Can anybody give any recommendations?

Edit: Yup. Considering a data viewer downstream of derived columns, AccountName2 still appears as DT_STR. Why not cast casting?

+4
source share
1 answer

The documentation states that the new data type is set correctly only if you decide to add a new column. You need to select "add as new column" from the "Derived column" drop-down list.

Or just use a data transformation transformation, which is probably easier if changing the data type is the only transformation you do.

+8
source

Source: https://habr.com/ru/post/1387041/


All Articles