Created
November 28, 2016 03:31
-
-
Save anonymous/6fc90ef62a7ef6484415ff914388f5be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create the execution object | |
DECLARE @execution_id BIGINT | |
EXEC [SSISDB].[catalog].[create_execution] | |
@package_name = N'Package2.dtsx' | |
, @project_name = N'Project1' | |
, @folder_name = N'Folder1' | |
, @use32bitruntime = False | |
, @reference_id = NULL | |
, @execution_id = @execution_id OUTPUT | |
-- System parameters | |
EXEC [SSISDB].[catalog].[set_execution_parameter_value] | |
@execution_id | |
, @object_type = 50 -- System parameter | |
, @parameter_name = N'SYNCHRONIZED' | |
, @parameter_value = 1 | |
-- Execute the package | |
EXEC [SSISDB].[catalog].[start_execution] @execution_id | |
-- Check package status, and fail script if the package failed | |
IF 7 <> (SELECT [status] FROM [SSISDB].[catalog].[executions] WHERE execution_id = @execution_id) | |
RAISERROR('The package failed. Check the SSIS catalog logs for more information', 16, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment