ALTER SERVICE (Transact-SQL)
Changes an existing service.
When the ALTER SERVICE statement deletes a contract from a service, the service can no longer be a target for conversations that use that contract. Therefore, Service Broker does not allow new conversations to the service on that contract. Existing conversations that use the contract are unaffected.
To alter the AUTHORIZATION for a service, use the ALTER AUTHORIZATION statement.
A. Changing the queue for a service
The following example changes the //Adventure-Works.com/Expenses service to use the queue NewQueue.
ALTER SERVICE [//Adventure-Works.com/Expenses]
ON QUEUE NewQueue ;
B. Adding a new contract to the service
The following example changes the //Adventure-Works.com/Expenses service to allow dialogs on the contract //Adventure-Works.com/Expenses.
ALTER SERVICE [//Adventure-Works.com/Expenses]
(ADD CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission]) ;
C. Adding a new contract to the service, dropping existing contract
The following example changes the //Adventure-Works.com/Expenses service to allow dialogs on the contract //Adventure-Works.com/Expenses/ExpenseProcessing and to disallow dialogs on the contract //Adventure-Works.com/Expenses/ExpenseSubmission.
ALTER SERVICE [//Adventure-Works.com/Expenses]
(ADD CONTRACT [//Adventure-Works.com/Expenses/ExpenseProcessing],
DROP CONTRACT [//Adventure-Works.com/Expenses/ExpenseSubmission]) ;

