我有一个 SSIS 包,我想使用存储过程在 SQL Server 代理 T-SQL 作业中运行,因为我在另一篇文章中描述了一个权限问题:
使用代理为 SQL Server 代理提供 Windows 凭据以访问 azure db 无法正常工作 (仍未解决)
我创建了一个测试用例,描述如下:
1.SSIS包运行:在Azure数据库中插入一行
2.执行包的脚本:
/* Create the execution object */
DECLARE @execution_id BIGINT
EXEC [SSISDB].[catalog].[create_execution]
@package_name = N'Package.dtsx'
, @project_name = N'test'
, @folder_name = N'test'
, @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)
PS:这段代码没有问题。它在查询中运行时成功执行。
3.创建工作
所有者:DOMAIN\USER_NAME
步骤(仅一步):
Type: T-SQL
3.1 Database: master
Advanced --> run as user: blank
Error message:
"Executed as user: DOMAIN\LAPTOP-4I64GKE3$. The package failed. Check the SSIS catalog logs
for more information [SQLSTATE 42000] (Error 50000). The step failed"
3.2 Database: master
Advanced --> run as user: dbo
Error message:
"Executed as user: dbo. The server principal "sa" is not able to access the database
"SSISDB" under the current security context. [SQLSTATE 08004] (Error 916). The step
failed."
3.3 Database: SSISDB
Advanced --> run as user: blank
Error message:
"Executed as user: DOMAIN\LAPTOP-4I64GKE3$. The package failed. Check the SSIS catalog logs
for more information [SQLSTATE 42000] (Error 50000). The step failed"
3.4 Database: SSISDB
Advanced --> run as user: dbo
Error message:
"Executed as user: dbo. The operation cannot be started by an account that uses SQL Server
Authentication.
Start the operation with an account that uses Integrated Authentication.
[SQLSTATE 42000] (Error 27123) The operation cannot be started by an account that uses SQL
Server Authentication.
Start the operation with an account that uses Integrated Authentication.
[SQLSTATE 42000] (Error 27123) The operation cannot be started by an account that uses SQL
Server Authentication.
Start the operation with an account that uses Integrated Authentication.
[SQLSTATE 42000] (Error 27123). The step failed."
测试用例结束。
似乎只有 3.4 方法更接近我的目标,但不知道下一步该做什么。
我应该尝试任何其他组合还是应该创建一个具有 Windows 身份验证的用户?
任何想法都有帮助