Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how to get alert mail from database even for alter

Author  Topic 

mohan123
Constraint Violating Yak Guru

252 Posts

Posted - 2012-11-01 : 02:59:51
Hello all,

In my database my data is so important that i need to get just alert mail from my database even a simple alter statement or dropping of table occurs in my database.As I don't know how to get this happen.But in my case need to get mail straight away for any simple alter changes

Suggest me

P.V.P.MOhan

mohan123
Constraint Violating Yak Guru

252 Posts

Posted - 2012-11-01 : 03:22:41
any suggestions i am not able to move a bit.i know about the datbase mail configuration wizard but how to get mail for even simple alter or drop happens in database..

P.V.P.MOhan
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-11-01 : 06:57:12
Two possible avenues are DDL triggers (synchronous processing) and event notifications (asynchronous processing). DDL triggers are probably easier to set up, and offer the ability to undo/rollback the change. Their only downside is that the add transaction overhead. If you're only sending email via Database mail then that's not likely to be a problem.

Event notifications use service broker to send a message to a queue. They operate asynchronously and therefore don't add as much overhead as DDL triggers. They also can't roll back the change, and require additional programming to actually send an email (via activation procedures). You also need to manage the queue associated with the notifications, and process messages so that they don't accumulate (using RECEIVE).

DDL Triggers: http://msdn.microsoft.com/en-us/library/ms175941.aspx
Event Notifications: http://msdn.microsoft.com/en-us/library/ms190427%28SQL.105%29.aspx
Service Broker: http://msdn.microsoft.com/en-us/library/ms345108%28SQL.90%29.aspx

All of these entries, and others, are also available in Books Online.

The question I need to ask is: why is there so much altering and dropping of tables? That's not a good practice.
Go to Top of Page
   

- Advertisement -