Created
April 26, 2018 08:45
-
-
Save juanonsoftware/79ec7f2a9f967bb0b29176bc17574440 to your computer and use it in GitHub Desktop.
To empty all messages from a queue
This file contains 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
begin tran | |
declare @c uniqueidentifier | |
while(1=1) | |
begin | |
select top 1 @c = conversation_handle from dto.YourQueueName | |
if (@@ROWCOUNT = 0) | |
break | |
end conversation @c with cleanup | |
end | |
commit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment