[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Email alert when data is written to a table

Posted on 2013-10-25
4
Medium Priority
?
262 Views
Last Modified: 2013-10-25
Trying to reduce expensive developer time on our DotNetNuke website. I don't think I need to go in to the backstory so I will simply ask - is there a way I can set up an alert (email, preferably) so that I am notified whenever anything is written to a specific SQL Server database table?
0
Comment
Question by:K_Deutsch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 20

Accepted Solution

by:
strivoli earned 2000 total points
ID: 39600714
Yes. Use a trigger on INSERT or UPDATE that sends a mail to an operator using SQL's built in mail system.
0
 

Author Comment

by:K_Deutsch
ID: 39600881
I set up an email account in SQL Server Database Mail and sent a successful test email, but I need a little more direction on building the alert, as this is new to me.

Database: ABC
Table: sp_ABC_DB_OnlineFormsConfirm
0
 

Author Comment

by:K_Deutsch
ID: 39601016
Actually I am almost there. The below was successfully tested, but is there a way that in the email generated I can insert the unique ConfirmationCode that is captured so the alerted person knows what exactly to follow up on?

CREATE TRIGGER SendEmail
ON [ABC].[dbo].[ABC_DB_OnlineFormsConfirm]
AFTER INSERT
AS
exec msdb.dbo.sp_send_dbmail @profile_name = 'Gmail',
            @recipients = 'ABC@ABC-inc.com',
            @subject='An ABC Online App Has Been Completed',
            @body=''
0
 
LVL 20

Expert Comment

by:strivoli
ID: 39601353
You should be able to add any data to the mail. Even the single field values.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question