ODBC/链接服务器身份验证/授权问题通过.NET运行代码中的存储过程

发布于 2025-01-25 00:20:54 字数 547 浏览 0 评论 0原文

我有一个存储过程,该过程访问了本地SQL Server实例上设置的链接服务器。链接的服务器配置为使用预配置的ODBC DSN&司机。直接从服务器本身上直接执行SMS时,该连接正常工作。我可以查询数据并根据需要进行操作。

但是,我有一个程序要运行和自动化存储过程。我还从服务器实例运行此程序。但是,当我尝试通过代码运行存储过程时,我会收到以下消息:

链接服务器“ CareLogic”的OLE DB提供商“ MSDASQL”报告了一个错误。身份验证失败。
无法初始化链接服务器“ CareLogic” Ole DB提供商“ MSDASQL”的数据源对象。
链接服务器“ careLogic”返回消息“ [hortonworks] [thriftExtension](8)
的OLE DB提供商“ MSDASQL”
身份验证/授权错误发生。错误详细信息:状态不良:http/1.1 401未经授权”。

careLogic是DSN/链接服务器的名称。我不确定权限折断位置。在身份验证中,身份验证在DSN本身而不是代码。

I have a stored procedure that accesses a linked server set up on the local SQL Server instance. The linked server is configured to use a preconfigured ODBC DSN & driver. The connection works fine when directly executing the sp from SMSS on the server itself. I can query data and manipulate it as I need.

However, I have a program that I want to use to run and automate the stored procedure. I'm also running this program from the server instance. However when I attempt to run the stored procedure via code, I get the following message:

The OLE DB provider "MSDASQL" for linked server "CARELOGIC" reported an error. Authentication failed.
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "CARELOGIC".
OLE DB provider "MSDASQL" for linked server "CARELOGIC" returned message "[Hortonworks][ThriftExtension] (8)
Authentication/authorization error occurred. Error details: Bad Status: HTTP/1.1 401 Unauthorized".

Carelogic is the name of the DSN/Linked Server. I'm not sure where the permissions break is. The authentication is done w/in the DSN itself and not in code. Any ideas or help would be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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