none
Forcing a Truncation warning in string to be error

    Question

  • Hi,

    If let say my source table has column with varchar(20) and my destination table has a column of varchar(5), I want SSIS to force to an error because of the truncation detected. Is it possible?

    Currently, warning is shown at design time that there is truncation but when package is run, the truncated data still gets inserted to destination.



    cherriesh

    Thursday, April 03, 2014 3:14 AM

Answers

  • Within the Error Output of (all?) tasks, there are instructions on what to do when truncation occurs. If you are genuinely getting truncated data in your target, then these instructions must be telling the task to ignore any truncation.
    • Marked as answer by cherriesh Friday, April 04, 2014 1:38 AM
    Thursday, April 03, 2014 8:51 PM
  • What I've done is to use a Data Conversion to detect the truncation and fail if there is.

    A while ago, i just have OLEDB Source and OLEDB Destination to do the insert. Using this method, it will just insert and truncate data if the data size is not sufficient.


    cherriesh

    • Marked as answer by cherriesh Friday, April 04, 2014 1:38 AM
    Friday, April 04, 2014 1:30 AM

All replies

  • If the value exceeds the allowed length it will fail.

    There is nothing like a C++ compiler flag in SSIS that would treat warnings as errors. Yet, it will never run under the circumstances you are asking for, it merely does not make sense.


    Arthur My Blog

    Thursday, April 03, 2014 8:36 PM
  • In my case, when it exceeds the allowed length, it was still inserted, but truncated.

    cherriesh

    Thursday, April 03, 2014 8:44 PM
  • Within the Error Output of (all?) tasks, there are instructions on what to do when truncation occurs. If you are genuinely getting truncated data in your target, then these instructions must be telling the task to ignore any truncation.
    • Marked as answer by cherriesh Friday, April 04, 2014 1:38 AM
    Thursday, April 03, 2014 8:51 PM
  • In my case, when it exceeds the allowed length, it was still inserted, but truncated.

    cherriesh

    Then you set to truncate.

    Arthur My Blog

    Thursday, April 03, 2014 9:15 PM
  • What I've done is to use a Data Conversion to detect the truncation and fail if there is.

    A while ago, i just have OLEDB Source and OLEDB Destination to do the insert. Using this method, it will just insert and truncate data if the data size is not sufficient.


    cherriesh

    • Marked as answer by cherriesh Friday, April 04, 2014 1:38 AM
    Friday, April 04, 2014 1:30 AM