matha_kharap
matha_kharap

Reputation: 41

Send e-mail if someone execute any query on the database

Basically, whenever the user execute any query(for example: SELECT query), I want the user get instantly notified by email that he or she has executed this(the full query he just used) query. The reason I want this because the data can be confidential, so for the security purpose. Thank you.

Upvotes: 0

Views: 92

Answers (1)

Christian Hoffmann
Christian Hoffmann

Reputation: 170

I would advise against using this approach.

If the data is confidential sending the mail after it has been retrieved seems to be too late. During nights it can take hours until such a mail is read and during vacations it can take days or even weeks. Also imagine checking 100s of mails each day which mostly contain unsuspicious querys. It's a headache.

Better set your database up so that confidential data can not be retrieved by personal which is not authorized to do so.

If you really want to set up a trigger for sending E-Mails you might want to take a look at this answer: Send e-mail from a trigger

Upvotes: 3

Related Questions