修改数据库后在应用程序中触发警报 [英] Triggering an alert in application when databse is modified

查看:98
本文介绍了修改数据库后在应用程序中触发警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个使用相同数据库的应用程序.
我希望一个应用程序在第二个应用程序修改数据库时生成电子邮件吗?
该怎么办呢?
我将MYSQL 5.1用作数据库,将C#3.5用于我的应用程序.

I have two applications that use the same database.
I want one application to generate an email when the database is modified by second application?
how would this can be done?
I am using MYSQL 5.1 as database and C# 3.5 for my applications.

推荐答案

对于每个SQL更新/插入/删除操作,请保留一个参数,该参数指示其是否来自application1或应用2.
根据此参数,在更新后插入,删除TRIGGER,然后通过电子邮件将其发送给您想要的任何人.

有关使用触发器发送电子邮件的信息,请参见:
使用带有提醒电子邮件的DML触发器 [
For every and any SQL update/insert/delete keep a parameter that tells if its from application1 or application2.
Based on this parameter, in AFTER update,insert,delete TRIGGER, send across an email to whomsoever you want to.

For sending emails using triggers, look here:
Using a DML trigger with a reminder e-mail message[^]


这篇关于修改数据库后在应用程序中触发警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆