SSIS包SSIS正在运行什么凭证?

时间:2021-08-21 11:33:59

I have package to access an excel file .xls. This file is located on network path.
The packaged is called from store with pass use32bitruntime = true. The store is called from C# code.
If the file is local file => the package run successfully.
If the file is network path => the package run failed.

Checking for network path:
I can access network path and even open file manually is successful.

我有包来访问excel文件.xls。此文件位于网络路径上。打包时从商店调用pass pass32bitruntime = true。该商店从C#代码调用。如果文件是本地文件=>包运行成功。如果文件是network path =>包运行失败。检查网络路径:我可以访问网络路径甚至手动打开文件成功。

So my question is what actually credential SSIS package running?
If it runs under my account that logg-in to SQL and call the store, it should be access the file. But it's not. It turns out another credential is substituted my own.
After search a quite long time, I can't find the answer.

所以我的问题是实际的凭证SSIS包运行了什么?如果它在我的帐户下运行登录到SQL并调用商店,它应该访问该文件。但事实并非如此。事实证明,另一个凭证取代了我自己的凭证。搜索了很长时间后,我找不到答案。

Any help on this is very appreciated.

对此有任何帮助非常感谢。

This is a store to execute SSIS

这是一个执行SSIS的商店

ALTER PROCEDURE [dbo].[execute_ssis_package]
 @folder_name varchar(100) 
 ,@project_name varchar(100)
 ,@package_name varchar(300)
 --,@RunAccount varchar(300) OUTPUT
 ,@output_execution_id BIGINT OUTPUT
AS
BEGIN

    SET NOCOUNT ON;

 DECLARE @execution_id BIGINT
 EXEC ssisdb.catalog.create_execution @folder_name,
           @project_name,
           @package_name,
           @use32bitruntime = True,
           @reference_id = Null,
           @execution_id = @execution_id OUTPUT

 Select @execution_id

 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.start_execution @execution_id
 SET  @output_execution_id = @execution_id

1 个解决方案

#1


1  

The credential that runs the SSIS package:

运行SSIS包的凭据:

If run from SQL Agent, it will run as Agent user running the Windows service.

如果从SQL Agent运行,它将作为运行Windows服务的代理用户运行。

If run from SQL Agent via proxy credentials, it runs under that credentials.

如果通过代理凭据从SQL代理运行,则它将在该凭据下运行。

If run from Windows scheduler via dtexec, it runs under the user as defined in the scheduler.

如果通过dtexec从Windows调度程序运行,它将在调度程序中定义的用户下运行。

In your case, you are using a stored proc, who calls that?

在你的情况下,你正在使用存储过程,谁调用它?

#1


1  

The credential that runs the SSIS package:

运行SSIS包的凭据:

If run from SQL Agent, it will run as Agent user running the Windows service.

如果从SQL Agent运行,它将作为运行Windows服务的代理用户运行。

If run from SQL Agent via proxy credentials, it runs under that credentials.

如果通过代理凭据从SQL代理运行,则它将在该凭据下运行。

If run from Windows scheduler via dtexec, it runs under the user as defined in the scheduler.

如果通过dtexec从Windows调度程序运行,它将在调度程序中定义的用户下运行。

In your case, you are using a stored proc, who calls that?

在你的情况下,你正在使用存储过程,谁调用它?