Search code examples
c#sql-serverssisetldtexec

Console application execute Dtsx file with error -1073679321


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.


Solution

  • Tanks Hadi, with your help I can resolve the problem. I would like complement your anwser.

    To resolve the problem, I made folow:

    • Uninstall all SQLServer instances and tools. You don't need remove SQL Management Studio only all features from the SQL Server.
    • Uninstall MV C++ 2017
    • Install MV C++ 2015
    • Install SQL Server Developer. During instalation select Integration Service in features 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.

    To check Integration Service status your need:

    • Open Services Manager of the Operational System and find name SQL Server Integration Services. The status from the service has be started.

    To download from SQL Server use microsoft site [https://www.microsoft.com/pt-br/sql-server/sql-server-downloads]

    Don't use SQL Server Express use Developer Edition. Also reade Hadi's Answer for more learning more.