简体   繁体   English

使用 EXECUTE sp_execute_external_script python 访问 SQL Server 2019 Dev 中的 map 驱动器

[英]access to map drive in SQL Server 2019 Dev with EXECUTE sp_execute_external_script python

i try to run我试着跑

EXECUTE sp_execute_external_script 
@language = N'Python',
@script = N'
import os
print (os.listdir(r"<share drive>"))
'

got:得到:

PermissionError: [WinError 65] Network access is denied: PermissionError:[WinError 65] 网络访问被拒绝:

i try to run this comment with UNC path and get the same error, i still didn't find any solution...我尝试使用 UNC 路径运行此评论并得到相同的错误,我仍然没有找到任何解决方案...

thank you!谢谢你!

See

By default, external Python and R scripts only have read access permission to their working directories.默认情况下,外部 Python 和 R 脚本仅对其工作目录具有读取权限。 If your Python or R scripts need access to any other directory, you need give either Read & execute and/or Write permissions to the NT Service\MSSQLLaunchpad service user account and ALL APPLICATION PACKAGES on this directory.如果您的 Python 或 R 脚本需要访问任何其他目录,您需要授予 NT Service\MSSQLLaunchpad 服务用户帐户和此目录上的所有应用程序包的读取和执行和/或写入权限。 Follow the steps below to grant access.请按照以下步骤授予访问权限。

  1. In File Explorer, right click on the folder you want to use as working directory, and select Properties.在文件资源管理器中,右键单击要用作工作目录的文件夹和 select 属性。
  2. Select Security and click Edit... to change permissions. Select 安全并单击编辑...以更改权限。
  3. Click Add...单击添加...
  4. Make sure the From this location is the local computer name.确保 From this location 是本地计算机名称。
  5. Enter ALL APPLICATION PACKAGES in Enter the object names to select and click Check Names.在 Enter the object names to select 中输入 ALL APPLICATION PACKAGES 并单击 Check Names。 Click OK.单击确定。
  6. Select Read & execute under the Allow column. Select 在允许列下读取并执行。
  7. Select Write under the Allow column, if you want to grant write permissions. Select 如果要授予写入权限,请在允许列下写入。
  8. Click OK and OK.单击确定和确定。

SQL Server 2019 on Windows: Isolation changes for Machine Learning Services SQL Server 2019 on Windows:机器学习服务的隔离更改

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

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