Reputation: 57
I have a Date output column in ssis package which length="0" and dataType="dbTimeStamp".
<outputColumn id="20" name="ChangeDate" description="" lineageId="20" precision="0" scale="0" length="0" dataType="dbTimeStamp" codePage="0" sortKeyPosition="0" comparisonFlags="0" specialFlags="0" errorOrTruncationOperation="Conversion" errorRowDisposition="FailComponent" truncationRowDisposition="FailComponent" externalMetadataColumnId="19" mappedColumnId="0"/>
When I am trying to run below query via sssis the it is giving the error:
SELECT
'No activity to report' as 'DeviceHostName'
,'' as [ChangeDate]
,'' as 'AffectedAccount'
,'' as [Message]
,'' as [OriginalValue]
,'' as [NewValue]
,'' as 'AttackerUserName'
Error:
Error: 2018-03-30 00:15:08.36 Code: 0xC020901C Source: Data Flow Task OLE DB Source [1] Description: There was an error with output column "ChangeDate" (20) on output "OLE DB Source Output" (11). The column status returned was: "The value could not be converted because of a potential loss of data.". End Error Error: 2018-03-30 00:15:08.36 Code: 0xC0209029 Source: Data Flow Task OLE DB Source [1] Description: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "output column "ChangeDate" (20)" failed because error code 0xC0209072 occurred, and the error row disposition on "output column "ChangeDate" (20)" 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. End Error Error: 2018-03-30 00:15:08.36 Code: 0xC0047038 Source: Data Flow Task SSIS.Pipeline Description: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "OLE DB Source" (1) returned error code 0xC0209029. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 12:15:01 AM Finished: 12:15:08 AM Elapsed: 7.281 seconds. The package execution failed. The step failed.
What should I write in the query to correct this.
Upvotes: 0
Views: 165
Reputation: 76
@Anurag: Please can you use NULL as [ChangeDate] instead of '' as [ChangeDate]
The issue you are facing seems to be because '' or blank string is not getting converted to the proper datatype.
Upvotes: 1