You are building the infrastructure for a service. You create a queue, and you need to have the queue active. Service Broker activates a stored procedure to handle messages. Currently, the stored procedure is not fnished, and you want to prevent its activation. Which method can you use?

You are building the infrastructure for a service. You create a queue, and you need to have the queue active. Service Broker activates a stored procedure to handle messages. Currently, the stored procedure is not fnished, and you want to prevent its activation. Which method can you use?


Answer: – CREATE QUEUE SalesQueue WITH STATUS = ON, ACTIVATION ( STATUS=OFF, PROCEDURE_NAME = sales_procedure, MAX_QUEUE_READERS = 10, EXECUTE AS SELF)

(The queue should be active, so its status should be ON. To prevent the activation of the specified stored procedure, the activation status should be OFF.)