Documentation of new database

  • 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?

  • 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)')

  • 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?

  • You can also check sql server logs for db craetion.

    "Keep Trying"

  • 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