执行包时,我正经历一个非常奇怪的情况。由于业务需求,包中所有DFT中的派生列已由脚本任务替换。SSIS中的临时脚本任务错误
发展执行包导致该错误的语句,有时偶尔错误为“值过大而被添加到缓冲区”,有时脚本任务失败说明
System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime
OR
The milliseconds value is out of bounds (not between 0 & 999).
处决期间接收一些其它错误消息如下所述: -
Description: Unspecified error End Error Error: 2016-11-24 10:51:03.37 Code: 0xC0047062 Source: Dft_x [279]
Description: System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime. at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket) End Error Error:
&
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on Flat File Source 1 returned error code 0xC02020C4. 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.
[OleDst_Pricing [165]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80004005 Description: "Invalid date format". [OleDst_xyz [165]] Error: There was an error with OleDst_xyz.Inputs[OLE DB Destination Input].Columns[DateColumn] on OleDst_xyz.Inputs[OLE DB Destination Input]. The column status returned was: "Conversion failed because the data value overflowed the specified type.". [OleDst_x [165]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "OleDst_xyz.Inputs[OLE DB Destination Input]" failed because error code 0xC020907A occurred, and the error row disposition on "OleDst_xyz.Inputs[OLE DB Destination Input]" 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.
[FltSrc_x 1 [313]] Error: The attempt to add a row to the Data Flow task buffer failed with error code 0xC0047020.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on FltSrc_BR_x 1 returned error code 0xC02020C4. 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.
但是扭捏DefaultMaxBufferRows & DefaultMaxBufferSize财产,我成功地执行包单独或通过SQL Server的约40倍的开发和测试环境,以确保它不会再次失败后, 。但生产执行再次失败,具有类似的日期特定错误。
我张贴包含在脚本的任务是在每个DFT的类似下面的代码: -
Public Class ScriptMain
Inherits UserComponent
Dim xyzArray() As String
Dim rowValue As String
Dim strDate As String
Dim columnxyz As String '= Me.Variables.MaterialMaster.ToString()
'Dim v1 As IDTSVariables100
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
rowValue = Row.XYZtoABC.ToString() + "~".ToString()
xyzArray = rowValue.Split(New Char() {"~"c})
strDate = Row.DateColumn.ToString()
columnxyz = Row.columnxyz.ToString()
CreateNewOutputRows()
End Sub
Public Sub CreateNewOutputRows()
ResultBuffer.AddRow()
ResultBuffer.xyz1 = xyzArray(1)
ResultBuffer.xyz2 = xyzArray(2)
ResultBuffer.xyz3 = xyzArray(3)
ResultBuffer.xyz4 = xyzArray(4)
ResultBuffer.xyz5 = xyzArray(5)
ResultBuffer.Datecolumn = CDate(strDate)
ResultBuffer.columnxyz = columnxyz
End Sub
End Class
对于日期列,在此任务之前使用派生列通过GETDATE()提供输入。 –
然后也许它是一个不同的列,但答案的一般点仍然是正确的。它与数据相关,偶尔会试图将值填充到无法保存的数据类型中。一种解决方案是在发生错误时使用TRY..CATCH来处理错误。 –