Excel Destination - cannot convert between unicode and non-unicode

  • I am using SQL SERVER 2005, I am having trouble in compiling my SSIS package,

    I have a dataflow task which contains and OLE DB Source, the data access mode for this is a SQL command, see below for the query.

    SELECT

    [Order Date]

    , [Time Into]

    , [TimeOut]

    FROM

    myTable

    This is connect to a Excel destination.

    But i get an error on the Excel destination

    Error1Validation error. Data Flow Task: Excel Destination [1311]: Column "Order Date" cannot convert between unicode and non-unicode string data types.

    GalaxyFinanceExtract.dtsx00

    How do I resolve this issue?

    thanks in advance

  • The [Order Date] column is being read as non unicode.

    You could cast it to unicode in your select statement

    e.g. SELECT CAST([Order Date] AS NVARCHAR(20)) AS [Order Date]

    FROM MyTable

    Ideally though, especially where dates are concerned, you should preserver the datetime datatype where you can. In other words the source column should be DATETIME column and the excel column should be a DATE format too. This should help you avoid the regional/locale issues that rear their head so often in ETL.

    HTH

    Kindest Regards,

    Frank Bazan

  • [font="Verdana"]

    Or even what you can try is, making a use of "DATA CONVERSION" Transformation. In a Data Conversion Transformation Editor, change the Data Type, i.e. String [DT_STR] TO Unicode String [DT_WSTR]. It worked for me.

    Mahesh[/font]

    MH-09-AM-8694

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply