我正在尝试设置查询通知,但是当我尝试创建队列和服务时,我收到错误消息“数据库中没有活动的 Service Broker。更改为包含 Service Broker 的数据库上下文。当我运行查询时
select is_broker_enabled from sys.databases where name='db01'
Run Code Online (Sandbox Code Playgroud)
它返回 1 表示已在数据库上启用代理
这是我正在运行以创建队列和服务的 sql 命令...
CREATE QUEUE DeviceChangeMessages
CREATE SERVICE DeviceChangeNotifications ON QUEUE DeviceChangeMessages ([http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification]);
Run Code Online (Sandbox Code Playgroud)