2016-11-28 5 views
1

パッケージを実行中に非常に特殊な状況が発生します。パッケージ内のすべての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.

しかし、それが再び失敗しないことを確認するために開発およびテスト環境に& DefaultMaxBufferSize財産、私は正常に実行されたパッケージを個別およびSQL Serverを介して約40倍をDefaultMaxBufferRowsを微調整した後。しかし、Productionの実行は、日付特定エラーと同様に失敗しました。

私はの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 

答えて

0

問題が関連データです。時々、日付として表現することができないデータをインポートし、それを日付として出力しようとしています。これをキャッチするコードはありませんので、エラーが発生しています。

あなたがTRY ... CATCHブロックでこの行を入れて、文字列が日付に変換できない場合にどうするかを決めることができました

strDateが特定のフォーマットを持っている

ResultBuffer.Datecolumn = CDate(strDate) 
+0

Dateカラムでは、このタスクの前に派生カラムを使用してGETDATE()によって入力が提供されています。 –

+0

それから、それは別の列ですが、答えの一般的な点はまだ正しいです。それはデータに関連しており、時にはそれを保持できないデータ型に値を埋め込むことを試みています。 1つの解決方法は、発生時にTRY..CATCHを使用してエラーを処理することです。 –

0

場合(つまり、 :"dd-MM-yyyy HH:mm:ss")。あなたは次のようにDate.ParseExact()機能を使用する必要があります。

ResultBuffer.Datecolumn = Date.ParseExact(strDate,"dd-MM-yyyy HH:mm:ss",System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None) 

あなたは多くの特定のフォーマットを持っている場合にも、あなたは文字列配列を宣言し、次のように、この関数に渡すことができます:

dim strFormats() as string = {"dd-MM-yyyy","yyyy-MM-dd"} 
ResultBuffer.Datecolumn = Date.ParseExact(strDate,strFormats,System.Globalization.CultureInfo.InvariantCulture,System.Globalization.DateTimeStyles.None) 

CDate機能あなたの地域の設定に関連しているので、作業するのがベストプラクティスですDate.ParseExact

DT_DATEの代わりにDB_TIMESTAMPDB_TIMESTAMPの列タイプとして使用することです

+0

strDateは、スクリプトタスクの前に派生列を使用してGETDATE()から入力を取得しています。それでも、Date.ParseExact()を使用する必要がありますか? –

+0

@MominGoni 'GETDATE()'はSQL Serverの照合順序に依存し、 'CDATE()'はマシンの地域設定に依存します – Yahfoufi

+0

@MominGoni 'DT_DATE'ではなく' DB_TIMESTAMP'を使用しようとしています – Yahfoufi

関連する問題