简体   繁体   English

在SQL Server上运行时,SSIS包无法访问目录

[英]SSIS package can't access directory when run on SQL Server

I am running a SSIS package which includes a script to check if a file exists. 我正在运行一个SSIS程序包,其中包含用于检查文件是否存在的脚本。

When I run this in Visual Studio under my Windows credentials, it works fine and can find the file within the directory and has access. 当我在Windows凭据下的Visual Studio中运行此文件时,它可以正常工作,并且可以在目录中找到该文件并具有访问权限。

When I deploy the package on to SQL Server and run it (still under my windows credentials, I even printed them in a log message within the script), it doesn't have access to the directory. 当我将程序包部署到SQL Server上并运行它时(仍然使用我的Windows凭据,我什至将它们打印在脚本内的日志消息中),它无法访问该目录。

Note: I am not running this within an agent job, I am directly running it under the integration service package within SQL Server Management Studio. 注意:我不在代理作业中运行此程序,而是在SQL Server Management Studio中的集成服务包下直接运行它。

Edit: The database is held on a remote server, which when I log into that server and use management studio there it all works fine. 编辑:数据库保存在远程服务器上,当我登录到该服务器并使用Management Studio时,一切正常。 If I connect to the remote server as me on my machine however it doesn't 如果我像在我的计算机上一样连接到远程服务器,则不会

Does anyone know why? 有人知道为什么吗?

Try giving read/write permissions to the SQL Database Engine Service account NT SERVICE\\MSSQL$<Instance Name> (Where <Instance Name> should be replaced by the installed instance name) : 尝试授予SQL数据库引擎服务帐户NT SERVICE\\MSSQL$<Instance Name>读/写权限(其中<Instance Name>应该替换为已安装的实例名称)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM