Clean up SSB Message Queue

Clean up SSB Message Queue

The following SQL script is used to clean up the specified SSB message queue, QUEUE_NAME.
***
declare @conversationHandle uniqueidentifier
while exists (select 1 from QUEUE_NAME)
begin
 RECEIVE top(1)  
  @conversationHandle=conversation_handle 
        FROM QUEUE_NAME
 End Conversation @conversationHandle
end

*** Key words ***
SQL Server 2005, Service Broker, Message Queue




原文地址:https://www.cnblogs.com/rickie/p/753799.html