Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanonsoftware/79ec7f2a9f967bb0b29176bc17574440 to your computer and use it in GitHub Desktop.
Save juanonsoftware/79ec7f2a9f967bb0b29176bc17574440 to your computer and use it in GitHub Desktop.
To empty all messages from a queue
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