パッケージを実行すると、有効な問題が発生しました。私のPCでは失敗し、他の人では成功しました。このエラーは、スクリプト コンポーネント (赤くなっている) が原因であり、スクリプト コンポーネントでの実行後ではなく、実行後フェーズにありますが、パッケージのランタイムにあります。エラーは次のとおりです。
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 Execute フェーズで何が行われるか教えてもらえますか? ありがとう
詳細情報: SQL Server を再インストールしようとしましたが、役に立ちません。また、変数を含むすべてのスクリプト コンポーネントが SSIS での実行に失敗したわけではありません (エラー 1 と同じパッケージではありません)。