Share via


How to: Deactivate Service Broker Message Delivery in Databases (Transact-SQL)

When message delivery is not active, messages remain in the transmission queue. To determine if Service Broker is active for a database, check the is_broker_enabled column of the sys.databases catalog view.

ms166035.security(en-US,SQL.90).gifSecurity Note:
Deactivating Service Broker prevents messages from being sent from or delivered to the database. However, this does not prevent messages from arriving in the instance. To prevent messages from arriving in the instance, you must remove or stop the Service Broker endpoint.

To deactivate Service Broker in a database

  1. Alter the database to set the DISABLE_BROKER option.

Example

USE master ;
GO

ALTER DATABASE AdventureWorks SET DISABLE_BROKER ;
GO

See Also

Other Resources

ALTER DATABASE (Transact-SQL)
sys.databases (Transact-SQL)
sys.transmission_queue (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance