只需使用 T-SQL 将消息添加到 SQL Server Service Broker 队列?

Simply add a message to a SQL Server Service Broker queue using T-SQL?(只需使用 T-SQL 将消息添加到 SQL Server Service Broker 队列?)
本文介绍了只需使用 T-SQL 将消息添加到 SQL Server Service Broker 队列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我因此创建了一个队列:

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
        );

我可以在 SSMS 中快速执行哪些操作以使用 T-SQL 将项目添加到我的队列中?

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

推荐答案

在 SSMS 中,在对象资源管理器中选择所需的数据库.然后找到这个数据库的Service Broker,右键单击它并选择'New Service Broker Application...'命令.这将为您创建模板以快速开始使用 Service Broker.此外,您还会看到实现和运行您自己的应用程序所需的最少推荐配置.

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.

至于使用一个队列 - 如果这是您第一次使用 Service Broker,为什么不一开始就遵循惯例?在运行多个示例和/或您自己的原型后,您决定使用多少队列,并且您知道如何使用.

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.

这篇关于只需使用 T-SQL 将消息添加到 SQL Server Service Broker 队列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

SQL query to group by day(按天分组的 SQL 查询)
Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
sql group by versus distinct(sql group by 与不同)
How to return a incremental group number per group in SQL(如何在SQL中返回每个组的增量组号)
Count number of records returned by group by(统计分组返回的记录数)
SQL GROUP BY CASE statement with aggregate function(带聚合函数的 SQL GROUP BY CASE 语句)