Simply add a message to a SQL Server Service Broker queue using T-SQL?

三世轮回 提交于 2019-12-13 04:26:08

问题


I created a queue thus:

CREATE QUEUE log_line_queue
WITH RETENTION = ON, --can decrease performance
    STATUS = ON,
    ACTIVATION (
        MAX_QUEUE_READERS = 1, --number of concurrent instances of sp_insert_log_line
        PROCEDURE_NAME = sp_insert_log_line,
        EXECUTE AS OWNER
        );

What can I do quickly in SSMS to add an item to my queue using T-SQL?


回答1:


In SSMS select required database in Object Explorer. Then find Service Broker of this database, right click on it and select 'New Service Broker Application...' command. This will create template for you to start using Service Broker quickly. Also you'll see minimal recommended configuration needed to implement and run your own application.

As for using one queue - if this is your first experience with Service Broker why not to follow common practice at the beginning? After running several samples and/or your own prototypes you decide how much queues to use and you know how to do it.



来源:https://stackoverflow.com/questions/14631474/simply-add-a-message-to-a-sql-server-service-broker-queue-using-t-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!