Microsoft.SqlServer.Dts.Runtime.Application app = new Microsoft.SqlServer.Dts.Runtime.Application();
            Package package = app.LoadPackage("ssis路径", null);
            package.InteractiveMode = true;
            Variables vars = package.Variables;
            IList keyList = list.GetKeyList();

    //设置ssis变量
            foreach (string key in keyList)
            {
                vars[key].Value = list[key].ToString ();
            }
            DTSExecResult rtn = package.Execute();

    if (package.Errors.Count > 0)
                {
                    StringBuilder builder = new StringBuilder();
                    builder.AppendLine(packagePath);
                    for (int i = 0; i < package.Errors.Count; i++)
                    {
                        builder.AppendLine(package.Errors[i].Description);
                    }

                    //记录日志信息
                    ExceptionLogger.Write(builder.ToString());
                }

相关文章:

  • 2021-08-05
  • 2021-09-19
  • 2021-08-02
  • 2021-08-12
  • 2021-08-05
  • 2022-12-23
  • 2021-05-05
  • 2021-09-05
猜你喜欢
  • 2021-09-03
  • 2022-02-03
  • 2021-10-04
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-09-16
相关资源
相似解决方案