views:

82

answers:

2

I am creating a job such that executes the following SQL statement.

select * from emp where sal > 5000

It is scheduled to execute on 3 PM every day.

Now my question is:
How to configure mail or alert such that when the job executes I have to receive a mail or alert indiactes query executed suceesully

+3  A: 

You can add success and fail (or both) notifications for a job. You assign then to an operator who has email, pager etc contacts.

Example:

How to: Notify an Operator of Job Status (SQL Server Management Studio)

gbn
+2  A: 

I would use the SQL Server Agent to send the emails.

You could so it by creating a stored procedure, and then run that in a job. Sending Automated Job Email Notifications in SQL Server with SMTP

Also Microsoft's link on how to go about it in 2005. MSDN 2005 Link

Here is another link on setting up SQL Server Mail in 2005, which you may find useful. Database Email

kevchadders