Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSISDB create_execution error: The current security context cannot be reverted. Please switch to the original database where 'Execute As' was called and try it again.

$
0
0

I'm trying to execute SSIS package from service broker activation procedure.

When SP is located in my database, I get following error:

"The current security context cannot be reverted. Please switch to the original database where 'Execute As' was called and try it again."

When the same SP is located in SSISDB, it works fine, but for consistency reasons I would prefer to have this procedure in my database.

To emulate this error we we can use following SP:

ALTER PROCEDURE [dbo].[ExecutePackage]
WITH EXECUTE AS 'dbo'
AS
BEGIN

DECLARE
	 @execution_id BIGINT;

EXEC [SSISDB].[catalog].[create_execution] 
	@package_name=N'Loader_DynamicPool.dtsx',
	@execution_id=@execution_id OUTPUT,
	@folder_name=N'SSIS Concurent',
	@project_name=N'SSIS Concurent',
	@use32bitruntime=False,
	@reference_id=Null;

DECLARE @var0 SMALLINT = 1;

EXEC [SSISDB].[catalog].[set_execution_parameter_value] 
	@execution_id,  @object_type=50, @parameter_name=N'LOGGING_LEVEL', @parameter_value=@var0;

exec [SSISDB].[catalog].[set_execution_parameter_value]
	@execution_id,  @object_type=50, @parameter_name=N'SYNCHRONIZED', @parameter_value=1;

EXEC [SSISDB].[catalog].[start_execution] @execution_id;

END;

and then call:

EXEC [dbo].[ExecutePackage]

Works in SSISDB, fails in user database.



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>