แก้ไข

แชร์ผ่าน


sp_replqueuemonitor (Transact-SQL)

Applies to: SQL Server Azure SQL Managed Instance

Lists the queue messages from a SQL Server queue or Microsoft Message Queuing for queued updating subscriptions to a specified publication. If SQL Server queues are used, this stored procedure is executed at the Subscriber on the subscription database. If Message Queuing is used, this stored procedure is executed at the Distributor on the distribution database.

Transact-SQL syntax conventions

Syntax

sp_replqueuemonitor
    [ [ @publisher = ] N'publisher' ]
    [ , [ @publisherdb = ] N'publisherdb' ]
    [ , [ @publication = ] N'publication' ]
    [ , [ @tranid = ] N'tranid' ]
    [ , [ @queuetype = ] queuetype ]
[ ; ]

Arguments

[ @publisher = ] N'publisher'

The name of the Publisher. @publisher is sysname, with a default of NULL. The server must be configured for publishing. NULL is used to get all Publishers.

[ @publisherdb = ] N'publisherdb'

The name of the publication database. @publisherdb is sysname, with a default of NULL. NULL is used to get all publication databases.

[ @publication = ] N'publication'

The name of the publication. @publication is sysname, with a default of NULL. NULL is used to get all publications.

[ @tranid = ] N'tranid'

The transaction ID. @tranid is sysname, with a default of NULL. NULL is used to get all transactions.

[ @queuetype = ] queuetype

The type of queue that stores transactions. @queuetype is tinyint, and can be one of these values.

Value Description
0 (default) All types of queues
1 Message Queuing
2 SQL Server queue

Return code values

0 (success) or 1 (failure).

Remarks

sp_replqueuemonitor is used in snapshot replication or transactional replication with queued updating subscriptions. The queue messages that don't contain SQL commands or are part of a spanning SQL command aren't displayed.

Permissions

Only members of the sysadmin fixed server role or db_owner fixed database role can execute sp_replqueuemonitor.