December 21, 2011 at 4:51 am
we have maintenance plan for couple of databases backup jobs..
I want to get Messages from sql server to my mail when ever job success or failure.
I don't have idea for configuring this.I shall be thankful if someone tel me how to do ..
December 21, 2011 at 5:05 am
Is Database Mail configured?
December 21, 2011 at 5:46 am
first configure database mail
then create a sql job
inside job there is an option notifications
write email id in that ...
Regards,
Skybvi
Regards
Sushant Kumar
MCTS,MCP
December 21, 2011 at 5:57 am
SKYBVI (12/21/2011)
first configure database mailthen create a sql job
inside job there is an option notifications
write email id in that ...
Regards,
Skybvi
Those options allow for send mail when job finishes or send mail when job fails, not both.
The way to get notification when the job finishes and when the job fails is to
Configure database mail
In the job, create 2 extra steps, one for when the job succeeds and one for when the job fails.
In the Advanced section of the original job step, change the on success action to send a mail and change the on failure action to send a mail.
The T-SQL to send a mail once database mail has been configured is:
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '',
@recipients = '',
@body = '',
@subject = ''
December 21, 2011 at 6:24 am
derekr 43208 (12/21/2011)
SKYBVI (12/21/2011)
first configure database mailthen create a sql job
inside job there is an option notifications
write email id in that ...
Regards,
Skybvi
Those options allow for send mail when job finishes or send mail when job fails, not both.
The way to get notification when the job finishes and when the job fails is to
Configure database mail
In the job, create 2 extra steps, one for when the job succeeds and one for when the job fails.
In the Advanced section of the original job step, change the on success action to send a mail and change the on failure action to send a mail.
The T-SQL to send a mail once database mail has been configured is:
EXEC msdb.dbo.sp_send_dbmail
@profile_name = '',
@recipients = '',
@body = '',
@subject = ''
For sending mails for both fail and success you can make a SSIS package .
That way easy.
Regards,
Skybvi
Regards
Sushant Kumar
MCTS,MCP
December 22, 2011 at 2:35 am
could you tel me which task/transformation i have to use in SSIS package for send messages from SQL SERVER to mail..
December 22, 2011 at 3:13 am
Create a operator & then go to job properties->Notification->select email when job succeeds.
December 22, 2011 at 3:27 am
mahesh.dasoni (12/22/2011)
Create a operator & then go to job properties->Notification->select email when job succeeds.
The poster wants to be notified in the event of the job finishing and when it fails, with the job notification, you can have only one - not both.
December 22, 2011 at 3:48 am
use job completes option which is used for both successful & failed jobs
December 22, 2011 at 6:17 am
geetha@in (12/22/2011)
could you tel me which task/transformation i have to use in SSIS package for send messages from SQL SERVER to mail..
Send mail task
Regards
Sushant Kumar
MCTS,MCP
December 22, 2011 at 6:18 am
mahesh.dasoni (12/22/2011)
use job completes option which is used for both successful & failed jobs
Correct
Regards,
Skybvi
Regards
Sushant Kumar
MCTS,MCP
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply