控制台应用程序执行 Dtsx 文件时出现错误 -1073679321
Console application execute Dtsx file with error -1073679321
我的代码没有问题。我知道因为控制台应用程序不仅仅在我的机器上执行。
基本上我加载包并在执行后。
我试过了:
- 以管理员身份执行Visual studio;
- 安装 Microsoft SQL Server Data Tools
的所有功能
服务状态
- SQL 服务器 (MSSQKSERVER) -> 已启动
- SQL 服务器 (SQLEXPRESS) -> 已启动
- SQL 服务器代理 (MSSQKSERVER) -> 已停止
- SQL 服务器代理 (SQLEXPRESS) -> 已停止
- SQL 服务器浏览器 -> 已停止
- SQL 服务器 CEIP 服务(SQLEXPRESS)-> 已启动
- SQL 服务器 Lounchpad (SQLEXPRESS) -> 已停止
- SQL 服务器报告服务 -> 停用
下面的代码,没有报错
using Microsoft.SqlServer.Dts.Runtime;
public void Execute()
{
Database database = DatabaseFactory.CreateDatabase("MyConnection");
try
{
parametrosConfig = new ParametrosConfigBatch();
string strPathPacote = parametrosConfig.PathDTSX;
DataTable _dt = new DataTable();
_dt = GetMyDataTable();
package = app.LoadPackage(strPathPacote, null);
Variables myVars = package.Variables;
package.Variables["User::varArquivo"].Value = _dt;
dtsResultado = package.Execute(null, myVars, null, null, null);
if (dtsResultado == DTSExecResult.Success)
{
...
}
else
{
...
}
}
catch (Exception ex)
{
...
}
finally
{
insert.Close();
}
}
结果我收到失败消息:运行 一个 SSIS 包在 SQL Server Data Tools 之外,安装 Integration Services Standard Edition(64 位)或更高版本。
Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
Error code: -1073679321
Description: To run an SSIS package outside SQL Server Data Tools, install Integration Services Standard Edition (64-bit) or later.
我认为需要安装一些东西,但不知道是什么。
根据您的问题,您似乎正在使用 SQL Server Express Edition,如果是这样,您将无法使用 SQL Server Integration Services,因为此版本不支持它们。 (It is only supported by Standard, Developer and Enterprise editions)
SSIS is not included with the Express edition of SQL Server.
您可以尝试使用 Developer Edition,因为它是免费的。
Tanks Hadi,在你的帮助下我可以解决问题。我想补充你的答案。
为了解决这个问题,我做了以下操作:
- 卸载所有SQL服务器实例和工具。您不需要从 SQL 服务器中仅删除 SQL Management Studio 的所有功能。
- 卸载 MV C++ 2017
- 安装 MV C++ 2015
- 安装SQL Server Developer。安装期间 select 集成服务中的功能 selections.
Don't forget reboot the operational system after uninstall process.
The SQL Server 2017 Setup result error whether you have the Microsoft Visual C++ 2017 installed in your Operational System.
The SQL 2017 needs of the MV C++ 2015. Because this you need remove the latest versions.
要检查您需要的集成服务状态:
- 打开操作系统的服务管理器并找到名称SQL Server Integration Services。来自服务的状态已经启动。
要从 SQL 服务器下载,请使用 Microsoft 站点 [https://www.microsoft.com/pt-br/sql-server/sql-server-downloads]
不要使用 SQL Server Express 使用 Developer Edition。另请阅读哈迪的回答以了解更多信息。
我的代码没有问题。我知道因为控制台应用程序不仅仅在我的机器上执行。 基本上我加载包并在执行后。
我试过了:
- 以管理员身份执行Visual studio;
- 安装 Microsoft SQL Server Data Tools 的所有功能
服务状态
- SQL 服务器 (MSSQKSERVER) -> 已启动
- SQL 服务器 (SQLEXPRESS) -> 已启动
- SQL 服务器代理 (MSSQKSERVER) -> 已停止
- SQL 服务器代理 (SQLEXPRESS) -> 已停止
- SQL 服务器浏览器 -> 已停止
- SQL 服务器 CEIP 服务(SQLEXPRESS)-> 已启动
- SQL 服务器 Lounchpad (SQLEXPRESS) -> 已停止
- SQL 服务器报告服务 -> 停用
下面的代码,没有报错
using Microsoft.SqlServer.Dts.Runtime;
public void Execute()
{
Database database = DatabaseFactory.CreateDatabase("MyConnection");
try
{
parametrosConfig = new ParametrosConfigBatch();
string strPathPacote = parametrosConfig.PathDTSX;
DataTable _dt = new DataTable();
_dt = GetMyDataTable();
package = app.LoadPackage(strPathPacote, null);
Variables myVars = package.Variables;
package.Variables["User::varArquivo"].Value = _dt;
dtsResultado = package.Execute(null, myVars, null, null, null);
if (dtsResultado == DTSExecResult.Success)
{
...
}
else
{
...
}
}
catch (Exception ex)
{
...
}
finally
{
insert.Close();
}
}
结果我收到失败消息:运行 一个 SSIS 包在 SQL Server Data Tools 之外,安装 Integration Services Standard Edition(64 位)或更高版本。
Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
Error code: -1073679321
Description: To run an SSIS package outside SQL Server Data Tools, install Integration Services Standard Edition (64-bit) or later.
我认为需要安装一些东西,但不知道是什么。
根据您的问题,您似乎正在使用 SQL Server Express Edition,如果是这样,您将无法使用 SQL Server Integration Services,因为此版本不支持它们。 (It is only supported by Standard, Developer and Enterprise editions)
SSIS is not included with the Express edition of SQL Server.
您可以尝试使用 Developer Edition,因为它是免费的。
Tanks Hadi,在你的帮助下我可以解决问题。我想补充你的答案。
为了解决这个问题,我做了以下操作:
- 卸载所有SQL服务器实例和工具。您不需要从 SQL 服务器中仅删除 SQL Management Studio 的所有功能。
- 卸载 MV C++ 2017
- 安装 MV C++ 2015
- 安装SQL Server Developer。安装期间 select 集成服务中的功能 selections.
Don't forget reboot the operational system after uninstall process.
The SQL Server 2017 Setup result error whether you have the Microsoft Visual C++ 2017 installed in your Operational System.
The SQL 2017 needs of the MV C++ 2015. Because this you need remove the latest versions.
要检查您需要的集成服务状态:
- 打开操作系统的服务管理器并找到名称SQL Server Integration Services。来自服务的状态已经启动。
要从 SQL 服务器下载,请使用 Microsoft 站点 [https://www.microsoft.com/pt-br/sql-server/sql-server-downloads]
不要使用 SQL Server Express 使用 Developer Edition。另请阅读哈迪的回答以了解更多信息。