在 SQL Server CLR 过程中使用 OLEDB 驱动程序时出现问题
我们正在尝试在 SQL Server 2005 计算机上创建 C# CLR 存储过程。 C# 代码通过 OLEDB 驱动程序连接到外部数据源以获取数据表。 它已经在单独的控制台应用程序上进行了测试,并且运行没有问题。 (OLEDEB 驱动程序是连接到专有数据库的专有驱动程序...)
在 SQL Server 上,我们已在程序集上设置了 EXTERNAL 权限级别,它是 StrongNamed,并且已在 SQL Server 中为其创建了 ASSYMETRIC KEY。
当我们尝试执行该过程时,我们遇到以下两个问题:
用于联系 OLEDB 的凭据 SQL 服务是那些 运行在,而不是凭据 sql contect 中的登录用户
引发 .NET Framework :
System.Security.SecurityException:请求 System.Data.OleDb.OleDbPermission 类型的权限
看来我们无法设法为进程提供运行 oledb 驱动程序所需的权限。 要么是我们的配置不足,要么是我们做错了什么。 将权限级别设置为 UNSAFE 也不是一个选项...
是否有人有此类问题的经验。 欢迎任何意见!
we are trying to create C# CLR Stored Procedure on a SQL Server 2005 machine. The C# code connects to an external datasource via an OLEDB driver to get a datatable. It has been tested on a separate console application, and it runs without problems.
(The OLEDEB Driver is a proprietary driver connecting to a proprietary DB...)
On SQL Server, we have set the EXTERNAL permission level on the assembly, it is StrongNamed and an ASSYMETRIC KEY has been created for it in the SQL Server.
When we try to execute the procedure we get the following two problems:
Credentials used to contact the OLEDB
are the ones that the SQL Service are
running under, and not credentials of
the logged user in the sql contecta .NET Framework is raised :
System.Security.SecurityException: Request for the permission of type System.Data.OleDb.OleDbPermission
It seems that we cannot manage to give the necessary rights to the process for it to run the oledb driver. Either that or our configuration is lacking, or we are just doing something wrong. Setting permission level to UNSAFE is also not an option...
Does anybody have any experience with this type of problems.
Any input would be welcome!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关于您的第一个问题(模拟):
http://blogs. msdn.com/sqlprogrammability/archive/2006/06/16/635004.aspx
http://www.codeproject.com/KB/database/SQLCLRIntegrationSecurity.aspx
Regarding your first issue (impersonation):
http://blogs.msdn.com/sqlprogrammability/archive/2006/06/16/635004.aspx
http://www.codeproject.com/KB/database/SQLCLRIntegrationSecurity.aspx