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




posted @ 2007-05-21 10:08  Rickie  阅读(536)  评论(0编辑  收藏  举报