The sqlServer database does not start the Service Broker problem solving

A few days ago, when I was doing database monitoring, there was a problem. The database did not start Service Broker, and then I found a solution on the Internet.

//检查数据库是否开启了Service Broker
SELECT name,is_broker_enabled FROM sys.databases WHERE name = '数据库名'
如果is_broker_enabled为0证明没有开启

//这两句一起执行,开启 Service Broker
ALTER DATABASE mkly SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE mkly SET ENABLE_BROKER;
修改后再查询is_broker_enabled为1时证明已经 Service Broker开启了

Guess you like

Origin blog.csdn.net/qq_54042324/article/details/125927353