Looking MSrepl_commands | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Looking MSrepl_commands

Hi
I need to buil a custom replication monitor, but there are some doubts:
1 – I know SQL Server 2000 store replicated text command in MSrepl_commands, at command field; but this is a binary field. I tried convert (convert(nvarchar(1024),command)) but some times the result don’t represent the equal command I sent (some times the conversion give formating chars). Is there some convert that I can use to receive a normal text?
2 – There is a proc (sp_browsereplcmds) that show me the text commands perfectaly, but the result coluns isn’t all that I need. Seek the source code from this proc, I watch a second proc (exec master..xp_printstatements), but I can’t run the proc by my applications (its return some erros from parameters). Does anyone know how to run this?? Tanks Esio Nunes
Try:
declare @query nvarchar(4000),@dbname sysname
set @query=’
select xact_seqno,originator_id,publisher_database_id,article_id,type,convert(int,partial_command),command
from MSrepl_commands
order by originator_id, publisher_database_id, xact_seqno,article_id,command_id

set @dbname=db_name()
exec master..xp_printstatements @query, @dbname
Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
OK, I alredy tried this, but if I change the query, the proc returns an error (xp_printstatements: error during statement retrieval and decoding), so I can’t customize the query. I tried
set @query=’
select article_id, xact_seqno,originator_id,publisher_database_id,article_id,type,convert(int,partial_command),command
from MSrepl_commands
order by originator_id, publisher_database_id, xact_seqno,article_id,command_id

Esio Nunes
]]>