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

本文介绍如何使用SQL Server 2005创建带有激活存储过程的队列,该存储过程作为服务程序运行。通过示例代码展示了配置队列属性如保留设置、最大读取实例数等方法,并提供了临时禁用激活操作的脚本。

SSB FAQ (2) – Create a stored procedure as a service program<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

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

 

 

 

转载于:https://www.cnblogs.com/rickie/archive/2006/12/27/605408.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值