Enable SQL Server Broker taking too long

前端 未结 4 1651
广开言路
广开言路 2020-12-12 12:14

I have a Microsoft SQL server 2005 and I tried to enable Broker for my database with those T-SQL:

 SELECT name, is_broker_enabled FROM sys.databases 
 -- che         


        
4条回答
  •  醉梦人生
    2020-12-12 12:14

    Enabling SQL Server Service Broker requires a database lock. Stop the SQL Server Agent and then execute the following:

    USE master ;
    GO
    
    ALTER DATABASE [MyDatabase] SET ENABLE_BROKER ;
    GO
    

    Change [MyDatabase] with the name of your database in question and then start SQL Server Agent.

    If you want to see all the databases that have Service Broker enabled or disabled, then query sys.databases, for instance:

    SELECT
        name, database_id, is_broker_enabled
    FROM sys.databases
    

提交回复
热议问题