<p>Just recently started having issues with an SQL Server Agent Job that contains an SSIS package to extract production data and summarize it into a separate reporting database. </p>

<p>I <em>think</em> that some of the Alerts/Notifications settings I tried playing with caused the problem as the job had been running to completion unattended for the previous two weeks.</p>

<p>So... Where's a good place to start reading up on SQL Agent Alerts and Notifications? <br />I want to enable some sort of alert/notification so that I'm always informed: </p>

<ol>
<li>That the job completes successfully (as a check to ensure that it's always executed), or </li>
<li>That the job ran into some sort of error, which should include enough info (such as error number) that I can diagnose the cause of the error</li>
</ol>

<p>As always, any help will be greatly appreciated!</p>

[{'answer_id': 22334, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>You\'ll want to have "When the job completes" marked in your notifications page on the job\'s properties.</p>\n\n<p>Just go to that dropdown and switch it to job completion instead of failure (which is on the screenshot).</p>\n\n<p><img src="https://i.stack.imgur.com/HGlQh.png" alt="Job_Properties_Notification"></p>\n\n<p>You\'ll also want to make sure that your server has e-mail configured. I think it\'s under SQL Surface Area Configuration for Features.</p>\n'}, {'answer_id': 22344, 'author': 'SQLMenace', 'author_id': 740, 'author_profile': 'https://Stackoverflow.com/users/740', 'pm_score': 0, 'selected': False, 'text': '<p>In each step of the job click on advanced then from there you can log to a file or to a table, this will have all errorcodes and other things why the job failed\nYou should be able to see this also from the job history. \nRight click on the job-->view history, click on the + sign to expand, the click on each step and it will be in the lower panel</p>\n\n<p>To set up notifications you need to set up an operator and the in the job on the notification tab you pick it from the email dropdown</p>\n'}, {'answer_id': 45329, 'author': 'Matt', 'author_id': 4154, 'author_profile': 'https://Stackoverflow.com/users/4154', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://msdn.microsoft.com/en-us/library/ms130214(SQL.90).aspx" rel="nofollow noreferrer">Books Online</a> is probably a good place to start (or at least I like it and generally find it useful).</p>\n\n<p>SQLMenace and bofe made some good points.  Here\'s my additional two cents:</p>\n\n<p>I\'d recommend <a href="http://msdn.microsoft.com/en-us/library/ms188298(SQL.90).aspx" rel="nofollow noreferrer">configuring Database Mail</a> rather than SQL Mail (i.e. SMTP vs. MAPI, which I think is deprecated anyway).  Once you get the mail profile configured, you\'ll have to also configure the SQL agent to use that mail profile (which is just a page of settings for the agent properties), or else your SSIS job notifications won\'t actually get sent, even though you can successfully send a test email from Management Studio.</p>\n\n<p>I don\'t use alerts as often as job notifications, so the only tricky thing I can recall about them is that if you\'re raising an error and you want the alert to email you when that happens, you have to make sure that the raised error gets written to the log.  I think that just boils down to "RAISERROR ... WITH LOG"; here\'s the <a href="http://msdn.microsoft.com/en-us/library/ms178592.aspx" rel="nofollow noreferrer">BOL link</a> for the syntax details. </p>\n'}]
['https://Stackoverflow.com/questions/22306', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2292/']