在 SQL Server CLR 过程中使用 OLEDB 驱动程序时出现问题

发布于 2024-07-12 08:19:24 字数 636 浏览 3 评论 0原文

我们正在尝试在 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 contect

  • a .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文