|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, December 23, 2011 3:36 PM
Points: 12,
Visits: 71
|
|
Please help me,Its urgent.
Thanks in Advance
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 7:11 AM
Points: 877,
Visits: 1,159
|
|
praveen.gln1 (12/20/2010) Please help me,Its urgent.
Thanks in Advance
can you please post what is the issue & which type of help do you require? Create trigger related help is available at: http://msdn.microsoft.com/en-us/library/ms189799.aspx
Thanks
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, December 23, 2011 3:36 PM
Points: 12,
Visits: 71
|
|
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.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 7:11 AM
Points: 877,
Visits: 1,159
|
|
praveen.gln1 (12/21/2010) 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 FOR CREATE_DATABASE AS PRINT 'Database Created.' GO
You can enhance the trigger as per your requirement. you can also drop the database the same way.
Thanks
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 7:11 AM
Points: 877,
Visits: 1,159
|
|
You can refer: http://msdn.microsoft.com/en-us/library/ms189799.aspx
Thanks
|
|
|
|