here is my issue
Am Produciton DBA and supporting 150+ servers(prod,DEv,UAT).i want to know about the users and database details who will create new databases on DEV machines.i require this for my documentation purpose.
If i will have trigger like this which sends mails to my alias then it will be easy for me to keep track of new database creation. I will be more help ful if i get script for deletion too.
You can create DDL Trigger on the server which you want to monitor.
Following trigger will fire whenever any user is creating the database on the server where you have created the trigger:
CREATE TRIGGER ddl_trig_database
ON ALL SERVER
PRINT 'Database Created.'
You can enhance the trigger as per your requirement.
you can also drop the database the same way.