You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

非创建者执行存储过程调用SSIS包失败求助

SSIS包通过存储过程执行权限问题

问题现象

  • SSIS包在Visual Studio中运行正常,包创建者(sysadmin身份)执行调用存储过程时也正常
  • 其他用户执行存储过程无直接报错,但Windows事件日志中记录System.AccessViolationException
  • 后续通过SSIS「所有执行」报告排查到实际错误:Select permissions denied on table

事件日志错误信息

Application: ISServerExec.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
   at Microsoft.SqlServer.XEvent.Configuration.SessionConfiguration.!SessionConfiguration()
   at Microsoft.SqlServer.XEvent.Configuration.SessionConfiguration.Dispose(Boolean)
   at Microsoft.SqlServer.XEvent.Configuration.SessionConfiguration.Finalize()

环境与包配置

  • 数据库版本:SQL Server 2019 Standard
  • SSIS包功能:将Excel .xlsx文件导入SQL Server
  • Visual Studio项目设置:Run64BitRuntime = False
  • 包保护级别:ProtectionLevel = DontSaveSensitive

调用存储过程代码

ALTER PROCEDURE [impexp].[udp_ImportSpreadsheet_PersonActionsAndEvents]
    @ActionID int
    , @FileName nvarchar(250)
AS
BEGIN
    SET NOCOUNT ON;

    DECLARE @execution_id bigint

    DELETE FROM [impexp].[PersonActionsAndEventsImport_CellNoMatch]
    WHERE ActionID = @ActionID;

    EXEC [SSISDB].catalog.create_execution
        @package_name=N'EventsImport.dtsx',
        @execution_id=@execution_id OUTPUT,
        @folder_name=N'Allusr_ImportsAndExports',
        @project_name=N'Imports',
        @use32bitruntime=TRUE,
        @reference_id=Null
    SELECT @execution_id

    -- 同步执行,确保后续代码在包完成后运行
    EXEC [SSISDB].[catalog].[set_execution_parameter_value] 
        @execution_id
        , @object_type = 50                     -- 系统参数
        , @parameter_name = N'SYNCHRONIZED'
        , @parameter_value = 1

    EXEC [SSISDB].[catalog].[set_execution_parameter_value]
        @execution_id,
        @object_type=30,
        @parameter_name=N'ActionID',
        @parameter_value=@ActionID

    EXEC [SSISDB].[catalog].[set_execution_parameter_value]
        @execution_id,
        @object_type=30,
        @parameter_name=N'FileName',
        @parameter_value=@FileName

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

权限配置情况

  • 存储过程已通过证书签名,证书关联用户拥有当前数据库的db_datareader和db_datawriter权限,且已在SSISDB中复制该证书及关联用户
  • 测试用户权限对比:
    • WorkingUser:sysadmin角色、包创建者,拥有Excel文件所在目录的完全权限,执行存储过程正常
    • FailingUser:属于SSISDB.public和msdb.db_ssisoperator角色,Excel目录权限与WorkingUser一致,执行失败
  • SSISDB文件夹权限:SSISDB.public对Allusr_ImportsAndExports文件夹拥有Read、Execute Objects、Read Objects权限;对Imports项目拥有Read和Execute权限

关键后续发现

FailingUser执行失败的实际原因是:SSIS包需要将Excel中不匹配的记录插入某表,但该用户无此表的SELECT权限。尽管存储过程已通过证书签名,且证书用户具备对应权限,但问题仍存在。

内容的提问来源于stack exchange,提问作者Katerine459

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 14:27:05