My code have not a problem. I know that because to console application don't execute only in my machine. Basically I load the package and after execute.
I tried:
- Execute Visual studio as Administrator;
- Install all features of the Microsoft SQL Server Data Tools
Services status
- SQL Server (MSSQKSERVER) -> STARTED
- SQL Server (SQLEXPRESS) -> STARTED
- SQL Server Agent (MSSQKSERVER) -> STOPED
- SQL Server Agent (SQLEXPRESS) -> STOPED
- SQL Server Browser -> STOPED
- SQL Server CEIP service (SQLEXPRESS) -> STARTED
- SQL Server Lounchpad (SQLEXPRESS) -> STOPED
- SQL Server Reporting Services -> DEACTIVATE
Below the code, but have not error.
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();
}
}
As result I receive Failure with message: To run an SSIS package outside SQL Server Data Tools, install Integration Services Standard Edition (64-bit) or later.
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.
I think that need install something, but a don't know what.