I want to be able to check the status of a publication and subscription in SQL Server 2008 T-SQL. I want to be able to determine if its okay, when was the last successful, sync, etc.. Is this possible?
I want to be able to check the status of a publication and subscription in SQL Server 2008 T-SQL. I want to be able to determine if its okay, when was the last successful, sync, etc.. Is this possible?
4条答案
按热度按时间6jygbczu1#
I know this is a little late....
41zrol4v2#
Old post but adding for others - The following stored procedure will give you what you need:
It allows you to view the status plus other information for all replication publications for a distributor (run it on the distribution database)
a6b3iqyw3#
In case it's helpful, I've combined parts of the two answers given and taken sp_replmonitorhelppublication and sp_replmonitorhelpsubscription and placed them into Temp Tables so I can sort them and exclude columns as needed.
Note, the subscriber script excludes some merge columns from sp_replmonitorhelpsubscription as I'm not looking for merge replication data.
eqqqjvef4#
For the answer from JM1
You might get an error:
Msg 8164, Level 16, State 1, Procedure sp_MSload_tmp_replication_status, Line 80 An INSERT EXEC statement cannot be nested.
The fix is simple enough at around line 34, replace:
with: