How to Enable/Disable SQL Server Service Broker in script
ALTER DATABASE OKQ8 SET SINGLE_USER WITH ROLLBACK IMMEDIATE--AFTER 60 SECONDS ALTER DATABASE OKQ8 SET ENABLE_BROKER --DISABLE_BROKER WITH NO_WAIT --do you stuff here ALTER DATABASE OKQ8 SET MULTI_USER
-----------------------
Appendix:
How to kill all user session on a database
ALTER DATABASE OKQ8 SET SINGLE_USER WITH ROLLBACK IMMEDIATE--AFTER 60 SECONDS --do you stuff here ALTER DATABASE OKQ8 SET MULTI_USER