SSB FAQ (2) – Create a stored procedure as a service program

SSB FAQ (2) – Create a stored procedure as a service program

 

The following code snippet shows you how to create a stored procedure as a service program.

 

CREATE QUEUE [dbo].[Queue_OutStock_Out] WITH STATUS = ON , RETENTION = OFF ,

ACTIVATION

(  STATUS = ON ,

PROCEDURE_NAME = [dbo].[usp_OutStock_OnReceiveMessage] ,

MAX_QUEUE_READERS = 5 , EXECUTE AS N'dbo'

)

 

Arguments:

RETENTION

Specifies the retention setting for the queue. If RETENTION = ON, all messages sent or received on conversations using this queue are retained in the queue until the conversations have ended. Setting RETENTION = ON can reduce performance. The default value for REENTION is OFF.

 

MAX_QUEUE_READERS = max_readers

Specifies the maximum number of instances of the activation stored procedure that the queue starts at the same time.

 

You can temporarily disable activation action by executing the following script.

Alter Queue Queue_OutStock_Out WITH ACTIVATION (STATUS=OFF)

 

The URL below has more detail.

SQL Server 2005 Beta 2 Service Broker: Stored Procedure acts as a service program

http://www.cnblogs.com/rickie/archive/2005/04/16/138658.html

 

 

 

posted @   Rickie  阅读(558)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示