Created
May 24, 2012 12:38
-
-
Save jdaigle/2781344 to your computer and use it in GitHub Desktop.
SQL Server Service Broker: Short Script to clear DISCONNECTED_INBOUND conversations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @handle UNIQUEIDENTIFIER; | |
WHILE (SELECT COUNT(*) from sys.conversation_endpoints (nolock) where state_desc = 'DISCONNECTED_INBOUND') > 0 | |
BEGIN | |
SELECT TOP 1 @handle = conversation_handle from sys.conversation_endpoints (nolock) where state_desc = 'DISCONNECTED_INBOUND'; | |
END CONVERSATION @handle WITH CLEANUP | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment