Query dtexec package executions

Simone Bottani 0 Reputation points
2024-07-29T07:11:08.7466667+00:00

We have a SQL Server where several packages are executed using dtexec, and I would like to retrieve the execution information and from which machines they are executed, but I can’t figure out where to find it. In the executions view, there are only the packages deployed in the Integration Service Catalog, not those executed with dtexec. Do you know how to retrieve this information?

Thanks in advance

Simone

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,998 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,591 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 37,671 Reputation points
    2024-07-29T07:21:00.2533333+00:00

    Hi @Simone Bottani,

    Here is a same thread on Q&A, you may take a reference to.

    Find which computer ran an SSIS package

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


  2. Olaf Helper 45,106 Reputation points
    2024-07-30T06:10:01.52+00:00

    If you haven't implemented an own logging, then you can't get the information who/where/when a SSIS package was executed directly with the dtexec tool.

    0 comments No comments

  3. Yitzhak Khabinsky 25,956 Reputation points
    2024-07-30T14:01:10.7466667+00:00

    @Simone Bottani,

    Starting from SSIS 2012 onwards, it is better to deploy SSIS Projects to SSIS Catalog (SSISDB database behind the scenes). That way you will have a full data on SSIS packages execution, and much more.

    I personally use the following T-SQL query to retrieve SSIS packages execution info.

    USE SSISDB;
    GO
    /*
    https://docs.microsoft.com/en-us/sql/integration-services/system-views/catalog-executions-ssisdb-database?redirectedfrom=MSDN&view=sql-server-ver15
    */
    SELECT duration = CONVERT(CHAR(12), DATEADD(MILLISECOND, msec + 86400000, 0), 114)
    	, t2.status_name, FORMAT(created_time,'yyyy-MM-dd HH:mm') AS start_time, *
    FROM CATALOG.executions as x
    INNER JOIN (VALUES (1, 'Created', 'Active')
    		, (2, 'Running', 'Active')
    		, (3, 'Canceled', 'Failed')
    		, (4, 'Failed', 'Failed')
    		, (5, 'Pending', 'Active')
    		, (6, 'Ended unexpectedly', 'Failed')
    		, (7, 'Succeeded', 'Succeeded')
    		, (8, 'Stopping', 'Active')
    		, (9, 'Completed', 'Failed')) as t2(status_id, status_name, status_group)
    ON x.status = t2.status_id
    	CROSS APPLY (VALUES (DATEDIFF(millisecond, start_time, end_time))) as t(msec)
    WHERE folder_name = '...'
    AND project_name = '...'
    AND package_name = '....dtsx'
    ORDER BY execution_id DESC;
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.