I have SQL Server 2012 SSIS. There are 2 databases. Import and Analyses.
I have Data Flow Task. Inside it I have OLE DB Source and OLE DB Destination.
Data type is orginally nvarchar(100). Destination is nvarchar(100) as well.
I would like to use UNION statement for Data Source, but getting errors. This is mystery for me.
WHAT IS BEST PRACTISE WHEN I USE SQL STATEMENT AND UNION STATEMENTS IN OLE DB SOURCE?
Example value for CustomerAddress is "Union Street 5". Defitely less than 100 nvarchar.
[OLE DB Source [42]] Error: There was an error with OLE DB Source.Outputs[OLE DB Source Output].Columns[CustomerAddress] on OLE DB Source.Outputs[OLE DB Source Output].
The column status returned was: "The value could not be converted because of a potential loss of data."
[OLE DB Source [42]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.
The "OLE DB Source.Outputs[OLE DB Source Output].Columns[TimingValue]" failed because error code 0xC0209072 occurred,
and the error row disposition on "OLE DB Source.Outputs[OLE DB Source Output].Columns[CustomerAddress]" specifies failure on error.
An error occurred on the specified object of the specified component.
There may be error messages posted before this with more information about the failure.
SELECT RowId,'Toyota' as 'CustomerName',CAST(CAddress AS nvarchar(100)) as 'CustomerAddress'
FROM [Integration].[dbo].[Import_A]
UNION
SELECT RowId,'Nissan' as 'CustomerName',CAST(CAddress AS nvarchar(100)) as 'CustomerAddress'
FROM [Integration].[dbo].[Import_B]
Kenny_I