做SqlDependency总结的一些经验
2013-08-05 13:54 CaiGen008 阅读(1560) 评论(0) 编辑 收藏 举报1、--查询是否具有Broker功能
1 select is_broker_enabled from sys.databases where [name]='DBName'
2、--打开Broker功能
--打开Broker功能
ALTER DATABASE DBNAME SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE DBNAME SET ENABLE_BROKER;
ALTER DATABASE DBNAME SET NEW_BROKER WITH ROLLBACK IMMEDIATE;
ALTER DATABASE DBNAME SET ENABLE_BROKER;
3、--建一个普通登录用户,授权给owner权限
GRANT SUBSCRIBE QUERY NOTIFICATIONS TO NewDBUSer