Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

job notification

Status
Not open for further replies.

Katy44

Technical User
Dec 12, 2003
723
GB
I have a job, and I'm trying to set up a notification for when it completes.

When I go in to create a new operator, I put in the email address and click Test. It tells me that "This will send the message...OK to send?". When I click OK it comes up saying "Error 22022: SQL Server Agent Error: The SQL Server Agent Mail Session is not Running;Check the mail profile and/or the SQL Server Agent Service Startup account in the SQL Server Agent Properties Dialog." When I run xp_sendmail on the same server with the same email address, it works fine. Does anybody know what is wrong? Thank you for any help.
 
SQL Server and SQL Server Agent run as NT services; note they are separate services. The message is telling you that the Agent service is not
running.
Thus you can connect to the datbase, run queries etc - the services
provided by SQL Server, but attempts to schedule jobs, run scheduled jobs etc will fail because the Agent is unavailable. The Agent can be restarted through
EM or Control Panel Serbvices. IT may be prudent to check round first to find out why the Agent is down.
 
Thanks - that's a lot clearer - I understand now why I can manually send email by running the stored procedure!
When I look at the SQL Server Agent on the server, it appears to be running ("Start" is greyed out, I have the option to "Stop"...any ideas?)
Also, there is a scheduled job which runs fine every morning, so it would seem that the agent is running - it's only the notifications I can't get to work.
 
I've just looked at the error log on SQL Server Agent and there are loads of these:

[264] An attempt was made to send an email when no email session has been established
 
I've figured it out thanks - I needed to pass in the mail account to SQL Server agent and restart, in the process of doing that now. Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top