April 8, 2008 at 1:54 pm
Does anyone have a good way to document when a new database has been added to an instance?
My first idea was a DDL trigger on sys.databases but to no avail
Any suggestions?
April 8, 2008 at 3:10 pm
this should get you started:
CREATE TRIGGER ddl_trig_database
ON ALL SERVER
FOR CREATE_DATABASE
AS
PRINT 'Database Created.'
SELECT EVENTDATA().value('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]','nvarchar(max)')
April 8, 2008 at 3:24 pm
As some of us discovered recently - you can also check the default trace, or use the "schema changes" report available on right-click in SSMS on the server name.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
April 10, 2008 at 12:52 am
You can also check sql server logs for db craetion.
"Keep Trying"
April 10, 2008 at 1:25 am
select name, create_date from sys.databases
---------------------------------------
elsasoft.org
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply