Sunday, February 24, 2013

Enabling SQL Server Service Broker

Below is the common script we used to enable the Service Broker in SQL Server 2008.

ALTER DATABASE <DatabaseName> SET ENABLE_BROKER;

Example:


ALTER DATABASE Northwind SET ENABLE_BROKER;

If you feel your database has an outstanding open connection, you have to clear it first before running the script. For you to terminate all connection, you have to set the current database to be single-user and call the rollback keyword to terminate it all. After executing the script, set back the database to be a multi-user database.

Example script:

ALTER DATABASE Northwind SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE Northwind SET ENABLE_BROKER;
GO
ALTER DATABASE Northwind SET MULTI_USER;
GO

Microsoft Documentation: Please visit this link for more information about SQL Server Service Broker.

1 comment:

  1. Do this hack to drop 2lb of fat in 8 hours

    More than 160,000 women and men are utilizing a simple and secret "water hack" to drop 1-2lbs every night in their sleep.

    It's very simple and it works with everybody.

    This is how you can do it yourself:

    1) Hold a glass and fill it with water half full

    2) Now follow this weight losing hack

    so you'll be 1-2lbs lighter when you wake up!

    ReplyDelete

Place your comments and ideas