tags:

views:

21

answers:

2

Hi

ALTER DATABASE [Database Name] SET ENABLE_BROKER; Does not respond, and works infinitely. SQL Agent service is running, what is chances?

Thanks

A: 

You should kill all processes for that Database first. Here is how to do.

http://www.kodyaz.com/articles/kill-all-processes-of-a-database.aspx

hakan
A: 

How long should I expect ALTER DATABASE … SET ENABLE_BROKER to run?

ALTER DATABASE ... SET ENABLE_BROKER requires exclusive access on the database and it will block if there is any other session in the database. To force it, you can use the WITH ROLLBACK clause that will kill any session that blocks your ALTER:

ALTER DATABASE [<dbname>] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;
Remus Rusanu