SQL Server 2008 Express 上的 SQL 依赖性

发布于 2024-11-28 05:26:35 字数 220 浏览 3 评论 0原文

我有一个应用程序成功地将 SqlDependency 与 SQL Server 2008 标准版结合使用。但是,如果我将连接字符串切换到 SQL Server 2008 Express(启用了代理),它就会停止工作。

我不确定这是否是 SQL Server Express 特有的,但我应该按照哪些步骤来找出问题的原因?

更新。我所说的“停止工作”是指 SqlDependency 不会引发通知

I have an application which successfully uses SqlDependency with SQL Server 2008 Standard Edition. But if I switch the connection string to SQL Server 2008 express (with enabled Broker) it stops working.

I'm not sure whether it is SQL Server Express specific, but which steps should I follow to find out the reason of the problem?

Update. By "stops working" I mean notifications are not raised by SqlDependency

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无法回应 2024-12-05 05:26:35

要了解 SQL 依赖关系的工作原理,我建议您阅读神秘通知。要对其进行故障排除,请按照正常的故障排除对话框步骤操作。正如您在文章中找到的那样,典型的罪魁祸首确实是 Service Broker 消息传递所需的 EXECUTE AS 上下文。您可以从 sys.transmission_queue 并将数据库所有者更改为有效登录名 (ALTER AUTHORIZATION ON DATABASE::[] TO [sa]) 将修复它。然而,可能还有其他问题。我的链接中的故障排除步骤将帮助您找到它们。

To understand how SQL Dependency works, I recommend that you read The Mysterious Notification. To troubleshoot it, follow the normal Troubleshooting Dialogs steps. The typical culprit is indeed, as in the article you found, the EXECUTE AS context required by Service Broker message delivery. You would see this easily from the transmission_status of the notification messages in sys.transmission_queue and changing the database owner to a valid login (ALTER AUTHORIZATION ON DATABASE::[<dbname>] TO [sa]) will fix it. However, there could be other problems. The troubleshooting steps in my link will help you find them.

感性不性感 2024-12-05 05:26:35

正如 @Remus 所指出的,我基于误导性文档的假设是错误的:SQL Server Express 确实在某种程度上支持 Service Broker,尽管许多在线资源表明它并不完全支持 SSB。不过,将其保留在这里,以便搜索可能会产生随后的对话框。

SqlDependency 似乎依赖于查询通知。查询通知又依赖于 Service Broker。 SQL Server Express 不支持 Service Broker。此页面未明确列出查询通知:

http://msdn.microsoft.com/en-us/library/cc645993(SQL.100).aspx

但是从那里您可以看到 Express 支持 Service Broker 作为仅限客户端,从下一页您可以看到 Service Broker 是一个依赖项(没有双关语):

http://msdn.microsoft.com/en-us/library/ms130764(v=SQL.100).aspx

As @Remus has pointed out, my assumptions based on the misleading documentation were wrong: SQL Server Express does support Service Broker to some extent, despite many online sources stating that it does not support SSB it all. Leaving this up here though so that searches may yield the dialog that ensued.

It seems that SqlDependency relies on Query Notifications. Query notifications in turn rely on Service Broker. Service Broker is not supported in SQL Server Express. This page doesn't list Query Notifications explicitly:

http://msdn.microsoft.com/en-us/library/cc645993(SQL.100).aspx

But from there you can see that Service Broker is supported by Express as a client only, and from the following page you can see that Service Broker is a dependency (no pun intended):

http://msdn.microsoft.com/en-us/library/ms130764(v=SQL.100).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文