OPENROWSET BULK共享文件夹的权限 [英] OPENROWSET BULK Permissions to Shared Folder

查看:140
本文介绍了OPENROWSET BULK共享文件夹的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用OPENROWSET功能将查询中的数据联接到文本文件中。

Use the OPENROWSET feature to JOIN data in a query against a text file.

利用@gbn在这个问题我正试图像OP一样打开一个行集;尽管文件格式略有不同。但是,尝试访问共享文件夹时出现以下错误:

Leveraging the answer from @gbn on this question I am trying to open a row set just like the OP; though the format of the file is a bit different. However, I'm getting the following error trying to access a shared folder:


Msg 4861,级别16,状态1,行1

Msg 4861, Level 16, State 1, Line 1

无法批量加载,因为无法打开文件 \MACHINENAME\Share\EC04.txt。操作系统错误代码5(访问被拒绝。)。

Cannot bulk load because the file "\MACHINENAME\Share\EC04.txt" could not be opened. Operating system error code 5(Access is denied.).



背景



请理解,我没有,并且没有访问SQL Server的权限,所以我不能将文件放在那里。

BACKGROUND

Please understand, I do not and will not have access to the SQL server and so I cannot place a file there.

该文件位于Windows 7 x64计算机上。

The file resides on a Windows 7 x64 machine.

该文件夹已被共享为读/用每个人 c写

The folder has been shared as Read/Write with Everyone.

有人可以帮助我了解允许SQL Server访问此文件夹的其他安全性吗?

Can somebody help me understand what other security I need to give to allow the SQL server to access this folder?

推荐答案

如果您以SQL登录名登录,则必须创建凭据进行此登录,此凭据必须具有足够的特权才能读取共享。

If you are logged in as a SQL login then you must create a credential for this login and this credential must have sufficient privileges to read the share.

如果,则以Windows登录名登录那么您必须启用Kerberos约束委派SQL Server服务帐户。

If you are logged in as a Windows login then you must enable Kerberos constrained delegation for the SQL Server service account.

现在,您似乎正在使用Windows登录名,并且由于模拟的上下文无法流经双跳,因此身份验证解析为ANONYMOUS LOGON不是所有人的成员,因此访问被拒绝。这完全是预期的行为。请咨询您的网络管理员,以了解如何为目标共享所需的SQL Server服务帐户设置约束委派。

Right now it seems you're using a Windows login and because the impersonated context cannot flow through the 'double hop' the authentication resolves to ANONYMOUS LOGON, which is not member of Everyone, hence the access denied. All this is exactly the expected behavior. Consult your network administrator about how to setup constrained delegation for the SQL Server service account targeting your desired share.

这篇关于OPENROWSET BULK共享文件夹的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆