用户登录
用户注册

分享至

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

  • 作者: 用户50791008
  • 来源: 51数据库
  • 2023-02-07

问题描述

我因此创建了一个队列:

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

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

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

推荐答案

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

In S**S 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.

软件
前端设计
程序设计
Java相关