Is this impossible?

  • I am trying to create either a store procedure or a trigger that records the names of all newly created tables along with the user's name that created the table. I am trying to do this for our development databases so each month I don't have to ask all the programmers if they have anything in the databases that they need to save. My goal is to be able to send them a list of all the tables that they created so they can tell me which ones they need for further testing/development.

    If anyone has any knowledge regarding how to do this, it would be greatly appreciated.

    Thanks!

    rblack

  • You could use a server side trace to record this information to a file, then load the file into a table, and query it.

    See sp_trace_setevent in bol for what events you can trace.

    PS Take a look at this link as well http://www.sqlservercentral.com/columnists/hji/trace.asp

    Edited by - steven_white40 on 09/04/2003 3:02:33 PM

    Steven

  • You might even try using C2 audit mode. This will produce a nice trace of those events without a lot to do ourself. However as with any tracing it is not suggested for permanent use in a production environment and if the traces fill up the drive your server will stop (that is the case with any tracing).

  • If they just create tables, then you can easily get the new tables from sysobjects. However, alters will be missed unless you are tracking the version of the current tables.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

    http://www.dkranch.net

  • quote:


    You might even try using C2 audit mode. This will produce a nice trace of those events without a lot to do ourself. However as with any tracing it is not suggested for permanent use in a production environment and if the traces fill up the drive your server will stop (that is the case with any tracing).


    one huge disadvantage with C2 is, that it traces everything. You cannot select what to trace. so there will be masses of unimportant information around

    Frank

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

Viewing 5 posts - 1 through 4 (of 4 total)

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