Solutions Products Download Purchase Support News Members Company
SITE FEED
Support Forum
The fastest and most effective to get answers to your questions quickly.
FAQs
Quick answers to common questions.
Troubleshooting
Known issues and basic troubleshooting techniques for problems or unexpected behaviors.
Knowledgebase
Technical tips, How-to articles, and other tutorials about ApexSQL Tools.
Online Documentation
All of our help files for download or convenient viewing online.
Videos
Watch product demos, training videos, or tutorials of our products' main features. 

ApexSQL Knowledgebase

Tips and How-to Articles for ApexSQL Tools


How to send email alerts when a change is made to a database record

DESCRIPTION
This article discusses how to customize the ApexSQL Audit architecture so that email alerts are sent out when changes are made to a database record.

These instructions make use of Database Mail and can only be used if you're using MS SQL Server 2005 or MS SQL Server 2008.

SOLUTION

1) Configure Database Mail.

2) Download ApexSQL2049_Mail.audx here. This architecture is specifically customized to allow for the sending of email alerts when a change occurs. Save this file in ApexSQL Audit's application folder. For example, C:\Program Files\ApexSQL\ApexSQLAudit2008.

3) Start ApexSQL Audit and connect to the database you want to audit.

4) Click File | Select Audit Architecture and select ApexSQL2049_Mail.audx.

5) Click File | Template Editor to modify the template.

4) Next, find and modify the following lines of code. Base the values you set here on how you set up your Database Mail.

'Customize values below
Mail_Profile = "John"
Mail_Recipients = "John@mymail.com"
Mail_Body = "Please verify database change."
Mail_Subject = "Unauthorized Database Change"

5) Click Run | Process and save the architecture file.

6) Close the Template Editor.

7) Create your triggers. If you have triggers set up already, they would have to be recreated if you want them to use the new architecture template.

What happens next? Triggers created using this template, when fired, will not only store audit data but will also send email alerts indicating that a change has been made.

Written by:
Janice Lee

Last Modified Date:
2 Feb 2010

Labels:



© 2010 ApexSQL Tools All Rights Reserved | 1.919.968.8444 | Contact Us | Terms of Use | Privacy Policy