SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Training
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Performance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
SQL Azure
Developer
General DBA
ASP.NET / ADO.NET
SQL Azure

USEFUL SITES :

ASP.NET Tutorials
Windows and SQL Azure Tutorials
Cloud Hosting Magazine
SharePoint Tutorials
Windows Server Help

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server

More     
 
Latest FAQ's

Add Node to A SQL Server failover Cluster failed with invalid ...
SQL Server Destination remote server error
Setting Up Data And Log Files For SQL Server
Will Check Constraints Improve Database Performance?

More     
   
Latest Software Reviews

dbForge Review
Spotlight on ApexSQL Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Data Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Doc 2008

More     

articles >> developer >> Sending SQL Server Notifications with CDOSYS ...

Sending SQL Server Notifications with CDOSYS

By : Desiree Harris
Sep 29, 2004

Page 2 / 3

Next, as an example we will create a job that will backup the Northwind database, then send a notification via e-mail when it completes successfully.

In Enterprise Manager, open 'Management' à 'SQL Server Agent', and then select and right-click on 'Jobs', and select 'New Job… '.

screen shot 2

On the 'General' tab name the job 'Backup Northwind'.

On the 'Steps' tab, click on 'New', enter the information below, and then click OK. (The path should be a path that exists on the SQL Server.)

screen shot 3

This is what you should see after you click 'OK'. Notice that the 'On Success' column says 'Goto next step' (this is ok, because we are about to create another step) and the 'On Failure' column says 'Quit with failure' (this is ok, because if the job fails, we don't want it to go to the next step).

screen shot 4

Now we'll add the job step that will notify us that the job has completed.
 

Click 'New…' and add the information below (everything between ' --- ').

----------------------------------------

Name:    SendNotification
Database:  Northwind
Command:   EXEC sp_send_cdosysmail
'from@emailaddress.com*', 
'to@emailaddress.com*',
'subject*',
'I've added an example message for you*
Team,

The Northwind database has been backed up successfully.

Thank you,
ORCS Web '
 

----------------------------------------

*fill in the fields with the desired information.

screen shot 5

Click on the 'Advanced' tab and change the 'On Success' box to 'Quit the job reporting success' and then click 'OK'.

screen shot 6

This is what the job should look like now.

screen shot 7

For our purposes, the 'Schedules' and 'Notifications' tabs default settings are fine; we will not need to make any changes. Click 'OK' and your job should appear in the job window.

screen shot 8

Now, right-click on the job we just created and click 'Start Job'.

screen shot 9

Make sure that the Job step named 'Backup' is selected then click start. When the job complete, you will be sent an email notification that looks like this.

screen shot 10

Now, even though email notifications can be setup as a 'job step,' you can also setup an alert based on a SQL Server event that will send an email and include details of the event. Next we will setup an alert that will send an email notification with details.


<< Prev Page     Next Page>>    








C# Help and Tutorials | PHP MySQL Tutorial | Sharepoint Tutorial | Azure Tutorial | Cloud Hosting Magazine | ASP.NET Tutorials | Windows Server Help | Windows Phone Pro | Silverlight Ace | Visual Studio Tutorials | Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | SQL Server Training Videos | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 2010 Jude O'Kelly. All rights reserved