0

From the replication monitor in sql server transactional replication, when I have a look at what has been replicated, from publisher to the distributor, I get the following picture:

enter image description here

It does not show on the replication monitor, therefore running the internal procedures to get hold of what has been read from the transaction log and replicated to the distributor I use the following procedure:

use [master]
exec [distribution]..sp_MSenum_logreader_sd 
@name = N'myserver-Product-102', 
@time = N'20170410 16:36:16.917'

this gives me the following results: (same data as on the picture above, plus more information)

enter image description here

Question:

I am struggling to find any documentation on the stored procedure that I use to find out what the log reader agent has been doing: sp_MSenum_logreader_sd

where can I find information about this procedure?

I also would like to save this info into a temp table or table variable, so that when I spot an error_id that is not zero I can get extra info as you can see below, based on the error_id from the picture above.

-- error_id 5467351 comes from the above result set
use [master]
exec [distribution]..sp_MSget_repl_error 
@id = 5467351

enter image description here

  • 2
    Have you looked at the output of sp_helptext 'sp_MSenum_logreader_sd' ? – Forrest Apr 11 '17 at 15:51
  • You can save the output via INSERT INTO TABLE EXECUTE syntax. The trouble is properly defining the TABLE in question, and I'm not knowledgeable enough of that SP to know if the query output changed between versions, so review the SP to create the table definition and should be able to retain the output with that method. Also, no restriction on type of table so either a temp table or table variable will suffice. – John Eisbrener Apr 11 '17 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.