February 12, 2003 at 4:23 pm
Hope this is an easy one: can anyone show me script/job that will notify me via email/netsend when my SQL Server restart or databases are added or deleted? For SQL 7.0 on NT 4 or SQL 2000.
thanks in advance
February 12, 2003 at 5:17 pm
For the SQL start, you can code a procedure that will send you the message and then mark this as a startup procedure. I'd use email in case your computer is not on.
As far as db add or delete, there isn't a way currently. There is no trigger. All you could do is setup a job that checks the current stuff against something you've stored.
Steve Jones
February 12, 2003 at 6:46 pm
Lumigent has a free tool that monitors DDL, possibly it catches the db add/del, havent had time to try it yet.
Andy
February 12, 2003 at 9:18 pm
If you are running SQL Server Agent, you can set up an alert to fire for both create and delete.
The error numbers you'll want are:
Create Database: 1805
Drop Database: 3738
When you create the alerts, you should receive a pop-up message indicating something to the effect of:
quote:
Occurrances of error <error number> will not invoke alert '<alert name>' by default since this error is not logged by default. Would you like to have the error always invoke the alert?
You'll need to choose yes for the alert to fire properly.
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
February 13, 2003 at 8:35 am
thanks again for the great feedback..
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply