Delete messages in service broker queue

前端 未结 5 515
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 07:31

I\'d like to clear my queue in SQL Server Management Studio, but I don\'t want to delete the whole queue just the content in the queue (the messages).

5条回答
  •  甜味超标
    2020-12-24 08:36

    If you are using SQL Server (starting with 2008) you can use RECEIVE

    WHILE (0=0)
    BEGIN
        RECEIVE * FROM dbo.YourQueue;
        IF (@@ROWCOUNT = 0) BREAK;
    END
    

提交回复
热议问题