title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sp_browsereplcmds (Transact-SQL) |
Returns a result set in a readable version of the replicated commands stored in the distribution database. |
markingmyname |
maghan |
randolphwest |
08/22/2024 |
sql |
replication |
reference |
|
|
|
[!INCLUDE SQL Server SQL MI]
Returns a result set in a readable version of the replicated commands stored in the distribution database, and is used as a diagnostic tool. This stored procedure is executed at the Distributor on the distribution database.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_browsereplcmds
[ [ @xact_seqno_start = ] N'xact_seqno_start' ]
[ , [ @xact_seqno_end = ] N'xact_seqno_end' ]
[ , [ @originator_id = ] originator_id ]
[ , [ @publisher_database_id = ] publisher_database_id ]
[ , [ @article_id = ] article_id ]
[ , [ @command_id = ] command_id ]
[ , [ @agent_id = ] agent_id ]
[ , [ @compatibility_level = ] compatibility_level ]
[ ; ]
Specifies the lowest valued exact sequence number to return. @xact_seqno_start is nchar(22), with a default of 0x00000000000000000000
.
Specifies the highest exact sequence number to return. @xact_seqno_end is nchar(22), with a default of 0xFFFFFFFFFFFFFFFFFFFF
.
Specifies if commands with the specified originator_id are returned. @originator_id is int, with a default of NULL
.
Specifies if commands with the specified @publisher_database_id are returned. @publisher_database_id is int, with a default of NULL
.
Specifies if commands with the specified @article_id are returned. @article_id is int, with a default of NULL
.
The location of the command in MSrepl_commands to be decoded. @command_id is int, with a default of NULL
. If specified, all other parameters must be specified also, and @xact_seqno_start must be identical to @xact_seqno_end.
Specifies that only commands for a specific replication agent are returned. @agent_id is int, with a default of NULL
.
Specifies the compatibility level of the [!INCLUDE ssNoVersion] instance. @compatibility_level is int, with a default of 9000000
.
0
(success) or 1
(failure).
Column name | Data type | Description |
---|---|---|
xact_seqno |
varbinary(16) | Sequence number of the command. |
originator_srvname |
sysname | Server where the transaction originated. |
originator_db |
sysname | Database where the transaction originated. |
article_id |
int | ID of the article. |
type |
int | Type of command. |
partial_command |
bit | Indicates whether this is a partial command. |
hashkey |
int | Internal use only. |
originator_publication_id |
int | ID of the publication where the transaction originated. |
originator_db_version |
int | Version of the database where the transaction originated. |
originator_lsn |
varbinary(16) | Identifies the log sequence number (LSN) for the command in the originating publication. Used in peer-to-peer transactional replication. |
command |
nvarchar(1024) | [!INCLUDE tsql] command. |
command_id |
int | ID of the command in MSrepl_commands. |
Long commands can be split across several rows in the result sets.
sp_browsereplcmds
is used in transactional replication.
Only members of the sysadmin fixed server role or members of the db_owner or replmonitor fixed database roles on the distribution database can execute sp_browsereplcmds
.