SET ENABLE_BROKER taking too long to execute

1

I ran the command ALTER DATABASE [Banco] SET ENABLE_BROKER; but it has been running for more than 20 minutes and counting. Would you have a faster way to do it?

    
asked by anonymous 10.03.2017 / 13:19

1 answer

1

Yes, there is a faster way:

ALTER DATABASE [Banco] SET ENABLE_BROKER WITH ROLLBACK IMMEDIATE;

SQL Server does not allow the command to run until all outstanding transactions have ended. With the above command, all pending transactions are canceled and the ENABLE_BROKER service is activated quickly.

    
10.03.2017 / 13:19