RAISERROR when replication falls behind
2
votes
2
answers
260
views
I have a third party incident management tool, that creates tickets from errors in the SQL logs.
Occasionally replication stops replicating without creating errors in the SQL logs.
I want to create a job that runs every 10 minutes or so to check on replication and then uses [RAISERROR](https://learn.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql?view=sql-server-ver15) to start our ticketing (*and alerting*) process.
There are a number of stored procedures to [Programmatically Monitor Replication](https://learn.microsoft.com/en-us/sql/relational-databases/replication/monitor/programmatically-monitor-replication?view=sql-server-ver15) that will show issues, and there is also a pretty good solution at [Monitoring Transactional Replication in SQL Server(*by Francis Hanlon 11 April 2013*)](https://www.red-gate.com/simple-talk/sql/database-administration/monitoring-transactional-replication-in-sql-server/) that is good start on what I want. But would need to be tweaked a bit to meet my needs. Before I start reworking Francis's solution I am wondering if there are any other solutions I might leverage on.
I have searched around here and google, and Francis's solution is the only one I found that gets close to inhouse monitoring, without new third party tools.
Are there any solutions to monitor SQL replication real time with T-SQL?
* SQL 2008 to SQL 2019
* Mostly transactional replication
* Same AND cross server replication
Asked by James Jenkins
(6318 rep)
Oct 30, 2019, 04:49 PM
Last activity: May 21, 2025, 01:02 PM
Last activity: May 21, 2025, 01:02 PM