Returns the commands for transactions marked for replication. This stored procedure is executed at the Publisher on the publication database.
The sp_replcmds procedure should be run only to troubleshoot problems with replication.
The ID of the article.
Indicates whether this is a partial command or not.
The command value.
The transaction sequence number.
The ID of the publication.
ID of the command in MSrepl_commands.
Type of command.
Server where the transaction originated.
Database where the transaction originated.
Internal use only.
ID of the publication where the transaction originated.
Version of the database where the transaction originated.
Identifies the log sequence number (LSN) for the command in the originating publication.
sp_replcmds is used by the log reader process in transactional replication.
Replication treats the first client that runs sp_replcmds within a given database as the log reader.
This procedure can generate commands for owner-qualified tables or not qualify the table name (the default). Adding qualified table names allows replication of data from tables owned by a specific user in one database to tables owned by the same user in another database.
Because the table name in the source database is qualified by the owner name, the owner of the table in the target database must be the same owner name.
Clients who attempt to run sp_replcmds within the same database receive error 18752 until the first client disconnects. After the first client disconnects, another client can run sp_replcmds, and becomes the new log reader.
A warning message number 18759 is added to both the Microsoft SQL Server error log and the Microsoft Windows application log if sp_replcmds is unable to replicate a text command because the text pointer was not retrieved in the same transaction.