Tracking specific error numbers
crimdon
Posts: 54 Bronze 3
I'd like to use SQL Monitor to track and alert me when specific SQL errors are generated. At the moment, I'm tracking 833 errors on one of our servers and am using SQL Agent Alerts to email.
Does anyone know a way of doing this on SQL Monitor?
Regards
Andrew
Does anyone know a way of doing this on SQL Monitor?
Regards
Andrew
Tagged:
Best Answer
-
crimdon Posts: 54 Bronze 3Hi there,
Thanks for your reply. I've decided to do it with a custom metric using this scrip:DROP TABLE IF EXISTS #errorLog;CREATE TABLE #errorLog(LogDate DATETIME,ProcessInfo VARCHAR(64),[Text] VARCHAR(MAX));DECLARE @starttime DATETIME = DATEADD(MINUTE, -5, GETDATE()), @now DATETIME = GETDATE()INSERT INTO #errorLogEXEC xp_readerrorlog 0,1,NULL, NULL, @starttime, @nowSELECT COUNT(*)FROM #errorLog aWHERE EXISTS(SELECT *FROM #errorLog bWHERE [Text] LIKE '%I/O requests taking longer than 15 seconds%'AND a.LogDate = b.LogDateAND a.ProcessInfo = b.ProcessInfo);DROP TABLE IF EXISTS #errorLog;
Regards
Andrew
Answers
Thanks for your post!
Unfortunately, there is no feature in SQL Monitor to track and send alerts for specific SQL Errors.
It might be possible using a Custom Metric, but it's not a feature we've provided or tested!