SSIS - How to convert codepage 1252 (ANSI - Latin I) to 20127 (US-ASCII)

Peter Bishop 181 Reputation points
2022-02-25T16:45:49.937+00:00

I'm trying to write to a flat file destination with a US-ASCII code page (20127) but my input columns are in code page ANSI - Latin I (1252).

I've tried using a "Data Conversion" task but the "Code Page" column of the column definition won't hold - it keeps going back to 1252.

I've tried using a "Derived Column" task with (DT_STR,50,20127)[col1] (which reports that it's the right code page, but then I get truncation errors even when the column isn't longer than 50 characters.

An ideas? Thanks.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,705 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 41,496 Reputation points
    2022-02-28T03:14:25.07+00:00

    Hi @Peter Bishop ,

    May I know what's your source type? If it is flat file source, you may change it from Flat File Connection Manager like shown.

    178255-image.png

    Use Derived Column task with (DT_STR,50,20127)[col1] should also work, check the length of the source data or add the length to see if it could resolve the issue.

    Try to redirect the 'error' rows to a separate file and then inspect them manually.

    You may also refer to converting-flat-file-8859-1-encoding-to-ole-db-destination-using-codepage-1252 to see if it is helpful.

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.