當我運行我的包時,我得到了一個有效的問題。它在我的電腦上運行失敗,在其他任何人都成功。 該錯誤是由腳本組件(變爲紅色)引起的,它處於Post Execute階段,而不是在腳本組件的後執行,而是在包的運行時。錯誤是:SSIS腳本組件運行時錯誤
Information: 0x40043008 at Data Flow Task, SSIS.Pipeline: Post Execute phase is beginning.
Error: 0xC0047062 at Data Flow Task, Script Component [263]: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariables100'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{22992C1D-393D-48FB-9A9F-4E4C62441CCA}' failed due to the following error: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD)).
我想,這個問題是有關的變量,因爲當我刪除所有相關變量的代碼,包成功運行。腳本組件中的代碼:
private int scheduled550;
private int scheduled620;
private int scheduled720;
private int scheduled820;
public override void PreExecute()
{
base.PreExecute();
scheduled550 = Variables.Count550;
scheduled620 = Variables.Count620;
scheduled720 = Variables.Count720;
scheduled820 = Variables.Count820;
}
public override void PostExecute()
{
base.PostExecute();
}
有沒有人遇到同樣的問題?任何人都可以告訴我什麼是POST執行階段嗎?謝謝
更多信息:我試圖重新安裝SQL Server,但這沒有幫助。並非所有帶有變量的腳本組件都在我的SSIS中運行失敗(不在與錯誤代碼相同的包中)
那麼PostExecute中導致數據流失敗的代碼是什麼? – billinkc
該問題說:Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSVariables100.Unlock() at Microsoft.SqlServer.Dts.Pipeline.ScriptComponent.UnlockReadOnlyVariables() at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PostExecute() ); – morgan117
但是我的PostExecute中沒有任何代碼,好像是在後臺。 – morgan117