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