SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to create Custom Alert.


How to create Custom Alert.

Author
Message
Sharon Kumar
Sharon Kumar
SSC Journeyman
SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)

Group: General Forum Members
Points: 87 Visits: 762
Hi.

I want to create a alert in sql server 2005.
I already have a query & i want it to run continuously for 24 hrs if it exceeds the condition it has to raise an alert.

May i know what is the way to create this type of alerts.

Your help is appreciated.
Adiga
Adiga
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2652 Visits: 21012
If the condition is true then you may Raise an Error using Raise Error. You can configure an alert which will send out an email whenever that particular Error Numger is raised in the Errorlog. The sample script of an alert is an below.


USE [msdb]
GO
EXEC msdb.dbo.sp_add_alert @name=N'test',
@message_id=100001, --This is the error number raised using Raise Error. Can be changed
@severity=0,
@enabled=1,
@delay_between_responses=0,
@include_event_description_in=1,
@job_id=N'00000000-0000-0000-0000-000000000000'
GO
EXEC msdb.dbo.sp_add_notification @alert_name=N'test', @operator_name=N'Production Support DBAs', @notification_method = 1
GO




Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
Sharon Kumar
Sharon Kumar
SSC Journeyman
SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)SSC Journeyman (87 reputation)

Group: General Forum Members
Points: 87 Visits: 762
DO i need to create any job for this query to run continuously..?
If Yes, This will effect any performance issues to my server.??
Adiga
Adiga
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2652 Visits: 21012
Since you are planning to run it round the clock, running it through a job is a better option. Running it through SSMS or SQL Agent job will have the same performance impact.

Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
@SQLFRNDZ
@SQLFRNDZ
SSC Eights!
SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)SSC Eights! (889 reputation)

Group: General Forum Members
Points: 889 Visits: 1217
what is the alert you want to get:?


--SQLFRNDZ

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search