Database mail notification when new database is created?

  • Hello,

    I'm pretty new to these forums so please excuse me if this has already been covered. The company I work for has just moved to SQL Server 2005, I have setup the servers and many databases and all is going well. Unfortunately, they also use SharePoint; I am looking for a way to receive an email notification when a new database is created on the server. I have already setup Database Mail and that too is working fine.

    Thanks

  • Can you please provide details on the notification requirements?

    The easiest way would be to use SQL Server Agent and WMI providers with "net send" alert notification.

  • You can capture the new database using a DDL trigger or an event notification. If you store that data off in some table, then you can track it. You can also use the Database Mail stored procedures in the trigger to send a notification to yourself when the event fires.

  • Thanks for the response.

    The notification would really only need to say that a new database had been created. Nothing fancy.

  • Example of WMI Event Alert:

    http://www.microsoft.com/technet/prodtechnol/sql/2005/newsqlagent.mspx

  • That WMI event has now totally confused me :unsure:

    Please remember that I am new to SQL Server 2005. Make it as idiot proof a possible.

    Many thanks

  • jsheed,

    the link I provided contains a chapter "Example of WMI Event Alert".

    This chapter contains a step-by-step instructions and code that you need to run. That is the easiest and most non destructive way to create notifications.

    If you can't repeat this code, I would seriously recommend hiring a consultant, since any other way (DDL triggers or event notifications using Database Mail) are more complicated than this one.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply