2017-05-26 73 views
2

我嘗試使用這段代碼運行SSIS時:如何知道SSIS運行包問題試圖執行

public class EjecutaPaquete { 

    private Microsoft.SqlServer.Dts.Runtime.Package pkgPaquete; 
    private Application appAplicacion; 

    public DTSExecResult EjecucionPaquete(string str_Paquete, List <CatVariablesEtl> Vars = null) { 

     DTSExecResult respuesta; 
     try { 
     appAplicacion = new Application(); 

     appAplicacion.PackagePassword = "mypass"; 

     pkgPaquete = appAplicacion.LoadPackage(str_Paquete, null); 

     foreach(CatVariablesEtl item in Vars) { 
      pkgPaquete.Variables[item.str_NombreVariable.ToString()].Value = item.str_ValorVariable.ToString(); 
     } 

     respuesta = pkgPaquete.Execute(); 

     return respuesta; 
     } catch (Exception ex) { 

     throw new NotImplementedException(); 
     } 

    } 

它讀取所有變量正確成的foreach,問題是,當嘗試執行包respuesta = pkgPaquete.Execute();首先它返回succeeded但是當它返回 「respuesta」 得到它failure

enter image description here

enter image description here

+0

您在使用Visual Studio中相同的變量進行調試SSIS包值 – Hadi

回答