Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Posts
    38

    Question Unanswered: Create/Drop Database Trace

    Hi Folks,

    How do I enable a trace for Create and Drop database to be logged into the SQL Server Event logs.

    I am using SQL 2005

    Thanks for your help!!

    Warm Regards,
    Ranjit S Hans

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    You can do it with either EventNotification or DDL trigger. My preference is the first, because it executes asynchronously, while DDL trigger executes synchronously, and its activity footprint is visible to the caller of the statement that triggered the trigger.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

  3. #3
    Join Date
    May 2006
    Posts
    38

    Smile

    Thanks so much !!

    I'd like to go in with EventNotification though DDL trigger looks fairly simple to implement.

    Btw .. How do you incorporate a trace for "Create / Drop database" for a SQL 2000 instance..

    Thanks once again

    Warm Regards,
    Ranjit S Hans

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    2K doesn't support neither of them. In 2K you can restrict or allow these operations through permissions.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •