--注:目标数据库 Test
--授予权限
USE Test
GRANT SEND ON SERVICE::[http://schemas.microsoft.com/SQL/Notifications/QueryNotificationService]
TO guest
--启用CLR
USE [master]
EXEC sp_configure 'clr enabled',1
RECONFIGURE
--验证数据库是否能够启用Service Broker
SELECT DATABASEPROPERTYEX('Test','IsBrokerEnabled')
--启用Service Broker
USE [master]
ALTER DATABASE Test SET ENABLE_BROKER