5
votes

I am importing a data set from Oracle using SSIS. SSIS is gives me a warning:

Truncation may occur due to retrieving data from database column "Third Party" with a length of 28 to data flow column "Third Party" with a length of 25."

The warning does not make sense. The destination is a SQL Server database where the attribute is [Third Party] as nvarchar(255).

Why is the tool giving me this odd error?

I have tried changing the length of the nvarchar(max). This did not make a difference.

select 
    case 
        when XTNL_HOS_FLG = 1 and VND_MG_APL_FLG = 0 
           then 'Host'          
        when XTNL_HOS_FLG = 0 and VND_MG_APL_FLG = 1 
           then 'Support or Manage' 
        when XTNL_HOS_FLG = 1 and VND_MG_APL_FLG = 1 
           then 'Host and (Support or Manage)'  
        else ''
    end  as "Third Party"
from 
    table1
3
try casting within sql command it is better then changing type from advanced editorYahfoufi

3 Answers

7
votes

Look in "Show Advanced Editor" in your Data Flow Task by right-click on Source Target. Then go to "input and output properties" tab and check the length of your columns.

Do the same on Destination Target.

Depending on the way you got your data, the type and length of columns aren't the same as the database.

0
votes

Since you are using an SQL Command as source you can edit you command and force the source column length and to help the OLEDB source to recognize it. You can use a CAST function to do that:

select CAST(
    case 
        when XTNL_HOS_FLG = 1 and VND_MG_APL_FLG = 0 
           then 'Host'          
        when XTNL_HOS_FLG = 0 and VND_MG_APL_FLG = 1 
           then 'Support or Manage' 
        when XTNL_HOS_FLG = 1 and VND_MG_APL_FLG = 1 
           then 'Host and (Support or Manage)'  
        else ''
    end AS NCHAR(255)) as "Third Party"
from 
    table1
0
votes

I did it like this: I used the command left(column,n) to match the output file.