setting an alert on new table creation

  • Hi. I want to set an alert on my production databases so that when a new user table gets created I'm notified. Can someone point me in the right direction on how to do this or is this even possible?

     

    Juanita

  • This was removed by the editor as SPAM

  • I guess you could put a trigger on the sysobjects table where the inserted xtype = 'U'.



    Shamless self promotion - read my blog http://sirsql.net

  • Thanks, I'll try that!

  • The trigger on system tables are not reliable... and not supported by Microsoft. The best way would be to do snapshots of that table every 5 minutes or so and check for new objects.

  • Thanks !!!!

  • Nicolas, if you could post a script that will create a trigger on sysobjects, that would be very good of you. AFAIK, it is not possible to create such a trigger at all.

    Juanita, two remarks from me:

    First: In a production system no common user should have such privileges as CREATE TABLE. This seems to be a rather "dynamic" approach, which isn't the best at all. However, Remi's suggestion is good.

    Second: The next version of SQL Server will contain DDL triggers.

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Thanks so much for the information !!! very important info !!

     

    Juanita

  • Just gave it a try, guess you can't create a trigger on there.



    Shamless self promotion - read my blog http://sirsql.net

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply