3

We upgraded our SQL Server from 2008 R2 to 2014.

I want to add a custom warning.

USE [msdb]
GO

EXEC msdb.dbo.sp_add_alert @name = N'MAN more than 1000', 
                           @enabled = 1, 
                           @delay_between_responses = 0, 
                           @include_event_description_in = 1, 
                           @performance_condition = N'Replication Dist.|Dist:Delivered     Cmds/sec|MyFancyReplication|>|1000', 
                           @job_id = N'00000000-0000-0000-0000-000000000000'
GO

This has worked with SQL Server 2008 R2.

When I want to add this Warning, but all I get is this error (it's translated, because my original is German)

A performance condition must be formatted as:
‘object_name|counter_name|instance_name|comparator( or < or =)|numeric value'.

Did you recognize the missing > in the error message?

Why can't I add my custom warning?

Best Regards

Björn

  • 1
    The documentation says > is allowed. I would suggest filing a bug on Connect. – Jon Seigel Jul 11 '14 at 14:16
  • I know that the documentation says greater than is allowed. I thing it's a bug in the sql server version... I was able to add this warning in sqlserver 2008r2 – derBjörn Jul 11 '14 at 14:25
  • I don't have 2014 installed at the moment. Does msdb.sys.sp_helptext 'dbo.sp_verify_performance_condition' shed any light on it? The relevant section in 2012 looks like this i.stack.imgur.com/W0rX6.png – Martin Smith Jul 13 '14 at 16:07
  • Hey Martin, the relevant section on my sqlserver14 looks exactly the same. I'm really confused about this and I can't imagine, why this is not working... – derBjörn Jul 14 '14 at 7:58
2

after research, I had found the answer. The Problem is the @performance_condition, my example will not work. But if I add a "SQLServer:" at the beginning of the Condition, like this:

N'SQLServer:Replication Dist.|Dist:Delivered Cmds/sec|MyFancyReplication|>|1000'

This is the Key to add custom warnings to Sql Server 2014. I believe this is a bug with the new SqlServer2k14.

Regards Björn

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.