You receive the below error when you try to enable service broker on a database.
This usually happens
Msg 9772, Level 16, State 1, Line 1
The Service Broker in database "<Database Name>" cannot be enabled because there is already an enabled Service Broker with the same ID. Msg 5069, Level 16, State 1, Line 1 ALTER DATABASE statement failed. |
This usually happens
- When the service broker is enabled on a database and it is overwritten and then you try to enable the service broker on it again
- When the service broker is enabled on a database and it is renamed and another database with the same name is created and then you try to enable the service broker on it again.
To fix this error, run the below command which will generate the new ID for the service broker.
ALTER DATABASE <Database Name> SET NEW_BROKER