Transact-SQL Reference

sp_browsereplcmds

Returns a result set in a readable version of the replicated commands stored in the distribution database. This stored procedure is executed at the Distributor on the distribution database.

Syntax

sp_browsereplcmds [ [ @xact_seqno_start = ] 'xact_seqno_start' ]
    [ , [ @xact_seqno_end = ] 'xact_seqno_end' ]
    [ , [ @originator_id = ] 'originator_id' ]
    [ , [ @publisher_database_id = ] 'publisher_database_id' ]
    [ , [ @article_id = ] 'article_id' ]
    [ , [ @command_id = ] command_id ]
    [ , [ @results_table = ] 'results_table' ]

Arguments

[@xact_seqno_start =] 'xact_seqno_start'

Specifies the lowest valued exact sequence number to return. xact_seqno_start is nchar(22), with a default of 0x00000000000000000000.

[@xact_seqno_end =] 'xact_seqno_end'

Specifies the highest exact sequence number to return. xact_seqno_end is nchar(22), with a default of 0xFFFFFFFFFFFFFFFFFFFF.

[@originator_id =] 'originator_id'

Specifies if commands with the specified originator_id are returned.  originator_id is int, with a default of NULL.

[@publisher_database_id =] 'publisher_database_id'

Specifies if commands with the specified publisher_database_id are returned. publisher_database_id is int, with a default of NULL.

[@article_id =] 'article_id'

Specifies if commands with the specified article_id are returned. article_id is int, with a default of NULL.

[@command_id =] command_id

Is 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.

[@results_table = ] 'results_table'

Specifies that a table by this name will be created, and the result set should be saved to this table instead of being returned to the client. results_table is sysname with a default of NULL. The table can then be used in additional queries, such as sorting the result set in a different order or manipulating it further.

Result Sets

sp_browsereplcmds is a diagnostic utility used to examine replicated commands stored in the distribution database. sp_browsereplcmds returns this result set.

Column name Data type Description
xact_seqno varbinary(16) Sequence number of the command.
originator_id int ID of the command originator.
publisher_database_id int ID of the Publisher database.
article_id int ID of the article.
type int Type of command.
command nvarchar(1024) Transact-SQL command.

Long commands can be split across several rows in the result sets.

Remarks

sp_browsereplcmds is used in transactional replication.

Permissions

Only members of the sysadmin fixed server role can execute sp_browsereplcmds.

See Also

sp_dumpparamcmd

sp_replcmds

sp_replshowcmds

System Stored Procedures