Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Get the user name and date time who modified or inserted data

Get the user name and date time who modified or inserted data

Scheduled Pinned Locked Moved Database
databasehelptoolsannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi All, I have a database in which most of the tables have Created by, modified by, Create Date and Modified date columns, for some child tables we don't have. The problem is developers are performing DML operations on those tables like insert with some inappropriate values or update without using modified by column. Then when they update it incorrectly we are unable to track who modified it. Is there any mechanism for me from Sql Scripts or any other who made those changes, so that I can track that out and let him/her know what incorrect change they made. Any help a code snippet, a link, a small script or even suggestion helps me. Thanks in advance.

    Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

    P J 2 Replies Last reply
    0
    • I indian143

      Hi All, I have a database in which most of the tables have Created by, modified by, Create Date and Modified date columns, for some child tables we don't have. The problem is developers are performing DML operations on those tables like insert with some inappropriate values or update without using modified by column. Then when they update it incorrectly we are unable to track who modified it. Is there any mechanism for me from Sql Scripts or any other who made those changes, so that I can track that out and let him/her know what incorrect change they made. Any help a code snippet, a link, a small script or even suggestion helps me. Thanks in advance.

      Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

      P Offline
      P Offline
      Peter_in_2780
      wrote on last edited by
      #2

      A quick Google for "sql audit trail" came up with Audit Trail Generator for Microsoft SQL[^] right here on CP. If you need to know who's messing with your data, how and when, an audit trail is the way to go. Cheers, Peter

      Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

      1 Reply Last reply
      0
      • I indian143

        Hi All, I have a database in which most of the tables have Created by, modified by, Create Date and Modified date columns, for some child tables we don't have. The problem is developers are performing DML operations on those tables like insert with some inappropriate values or update without using modified by column. Then when they update it incorrectly we are unable to track who modified it. Is there any mechanism for me from Sql Scripts or any other who made those changes, so that I can track that out and let him/her know what incorrect change they made. Any help a code snippet, a link, a small script or even suggestion helps me. Thanks in advance.

        Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."

        J Offline
        J Offline
        John C Rayan
        wrote on last edited by
        #3

        You should enforce INSERT/UPDATE triggers for these auditing purposes. You cannot reply on the developers to implement this.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups