Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Posts
    1

    Unanswered: Auditing a table for SQL Server

    I'm a programmer, and not a DBA, so I need some help here. I'm trying to figure out how to set up some auditing within a production database.

    Basically what I have to do is, I need to log all record deletions from a particular table. I've been looking through SQL Profiler, but so far I haven't been able to figure out how to do this.

    Any help would be greatly appreciated.

    Thanks.

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Best way would probably be to implement a trigger on the table that inserts the deleted record into a backup table, alnog with the date it was deleted. This table would have to get purged every once in a while, in order to make sure that it itself does not become larger than the table you are auditing, though. Hope this helps.

  3. #3
    Join Date
    Jul 2002
    Location
    IA
    Posts
    28
    Or add buisness logic. On our 'user' table, we shut them off with a datetime column, rather than delete them, for example.
    Thanks,
    Jason

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    If you can afford then use Lumigent's ENTEGRA which is best used tool to audit the database events at all levels.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

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