2016-05-20 68 views
0

我有一個屬性tlost,下面的定義在XSD文件中。我已經試過use="required"use="optional"SSIS XML源錯誤 - 輸入字符串格式不正確

<xs:attributeGroup name="defense"> 
     <xs:attribute name="tlost" use="required" type="xs:decimal"/> 
</xs:attributeGroup> 

在XML文檔中,我試圖導入我會得到這樣一個值以下:

<defense ast="0" category="special_team" tlost="0" int="0"/> 

我執行的SSIS包,是以tlost值並將其插入到一個SQL數據庫表。數據庫表中的列的數據類型爲DECIMAL(28,10),並且允許null s。

當我執行包時,以前的值完美工作,並插入數據。但是,當我在XML文件中得到tlost=""的值時,程序包將失敗並且未插入記錄。

在數據流路徑編輯器中,tlost的數據類型爲DT_DECIMAL。當我檢查XML Source的高級編輯器時,輸入和輸出屬性的tlost數據類型爲小數點[DT_DECIMAL]

我不明白爲什麼這是失敗的。我試圖創建派生列並將其轉換爲(DT_DECIMAL, 10)數據類型。這沒有用。我試圖檢查一個空值,並替換爲0如果爲空,那沒有用。所以我只是一起忽略了列,並且在派生列任務中,我用(DT_DECIMAL, 10) 0替換了tlost列值,只是插入0值並忽略xml文件中的任何內容,並且作業仍然失敗,並顯示以下錯誤消息:

Error: 0xC020F444 at Load Play Summary Tables, XML Source [1031]: The error "Input string was not in a correct format." occurred while processing " XML Source.Outputs[defense].Columns[tlost] ".

Error: 0xC02090FB at Load Play Summary Tables, XML Source [1031]: The "XML Source" failed because error code 0x80131537 occurred, and the error row disposition on " XML Source.Outputs[defense].Columns[tlost] " at " XML Source.Outputs[defense] " specifies failure on error. An error occurred on the specified object of the specified component.

Error: 0xC02092AF at Load Play Summary Tables, XML Source [1031]: The XML Source was unable to process the XML data. Pipeline component has returned HRESULT error code 0xC02090FB from a method call.

Error: 0xC0047038 at Load Play Summary Tables, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on XML Source returned error code 0xC02092AF. 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.

請幫忙。我已經用盡了所有可以解決這個問題的想法。我正在處理數百個文件,並且每次發生此問題時都無法繼續修復損壞的數據文件。

回答

0

能否請您嘗試以下

1 - 更改爲數據類型爲字符串XSD和裝載到表之前照顧的數據類型轉換。 2 - 如果可能的話通過傳遞你的XML生成的XSD,然後驗證數據類型,並相應地使用它...

休息的XSD的可相應改變...

下面

是屏幕抓取什麼我試過了。希望它有幫助![enter image description here] 1