Archive for the ‘SSIS’ Category
SSIS 2012 (SSISDB)- Check execution status of SSIS Package
Posted by Pramod Singla on November 27, 2015
Problem Statement: How to check the execution status of a SSIS package, deployed in SSISDB, using system tables?
Solution:
DECLARE @status INT=2/*Running The possible values are created (1), running
(2), cancelled (3), failed (4), pending (5), ended unexpectedly (6), succeeded (7),
stopping (8), and completed (9)*/
SELECT *
FROM catalog.executions
WHERE status = @statusSELECT e.executable_id,e.package_name,
e.[executable_name],
es.[execution_path],
es.[execution_duration],
[execution_result] = CASE es.[execution_result]
WHEN 0 THEN ‘Success’
WHEN 1 THEN ‘Failure’
WHEN 2 THEN ‘Completion’
WHEN 3 THEN ‘Cancelled’
END,
es.start_time,
es.end_time
FROM [SSISDB].[catalog].[executables] e
INNER JOIN [SSISDB].[catalog].[executable_statistics] es
ON es.[executable_id] = e.[executable_id]
WHERE e.execution_id IN (SELECT execution_id
FROM catalog.executions
WHERE status = @status)
ORDER BY e.executable_id DESC,es.start_time DESC
Posted in SQL Server 2012, SSIS | 1 Comment »
SQL server 2012: Kill SSIS package Execution in Integration Services catalog
Posted by Pramod Singla on June 8, 2015
Problem: How to kill a SSIS package execution in the Integration Services catalog?
Solution: This can be achieved via two methods i.e. using GUI or TSQL. The GUI is very slow in fetching list of active sessions so you can use TSQL to kill the SSIS package session.
Use following script to Kill SSIS package in Integration Services catalog:
–change “YourpackageName” with the actual package name
DECLARE @package_name SYSNAME =‘YourpackageName.dtsx’
DECLARE @execution_id BIGINTSELECT @execution_id = Max(execution_id)
FROM ssisdb.catalog.executions
WHERE package_name = @package_name
AND end_time IS NULLSELECT @execution_id
EXEC ssisdb.catalog.Stop_operation
@operation_id =@execution_id
Posted in SSIS | Tagged: dba, sql server 2012, ssis catalog service, SSIS session | 1 Comment »