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. How to auto detect row version, if some one update manually

How to auto detect row version, if some one update manually

Scheduled Pinned Locked Moved Database
databaseannouncementsql-serversysadminjson
5 Posts 4 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.
  • M Offline
    M Offline
    Md Marufuzzaman
    wrote on last edited by
    #1

    Hi guys, I am looking for the best ways to create an api which will monitor the database table row version. if this api found any row update manually (i.e., directly login to SQL server) than it will send an acknowledgement with the following information: (1) LogIn detail of the data server. (2) Access database name with datatime. (3) Affected table name, row version and row number as well. I will be glad for your any suggestion / ides on that.

    Thanks Md. Marufuzzaman


    I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

    J L 2 Replies Last reply
    0
    • M Md Marufuzzaman

      Hi guys, I am looking for the best ways to create an api which will monitor the database table row version. if this api found any row update manually (i.e., directly login to SQL server) than it will send an acknowledgement with the following information: (1) LogIn detail of the data server. (2) Access database name with datatime. (3) Affected table name, row version and row number as well. I will be glad for your any suggestion / ides on that.

      Thanks Md. Marufuzzaman


      I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

      J Offline
      J Offline
      Jan Steyn
      wrote on last edited by
      #2

      I currently use

      HOST_NAME()

      and

      APP_NAME()

      in a trigger for insert, update and delete to monitor for anything that wasn't supposed to happen. You can then include any of the detail from INSERTED and DELETED tables as well as connection info. HTH

      M 1 Reply Last reply
      0
      • J Jan Steyn

        I currently use

        HOST_NAME()

        and

        APP_NAME()

        in a trigger for insert, update and delete to monitor for anything that wasn't supposed to happen. You can then include any of the detail from INSERTED and DELETED tables as well as connection info. HTH

        M Offline
        M Offline
        Md Marufuzzaman
        wrote on last edited by
        #3

        Hi, Thanks for the replay, well if we consider the scenario given below: if any user: 1. logIn to the database -> open the table in design mode--> block the trigger. 2. Update a single column value. 3. Unblock the trigger - > Save the table. I am thinking on how could I detect the changes from my C# application. Thanks once again for your valuable input.

        Thanks Md. Marufuzzaman


        I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

        P 1 Reply Last reply
        0
        • M Md Marufuzzaman

          Hi, Thanks for the replay, well if we consider the scenario given below: if any user: 1. logIn to the database -> open the table in design mode--> block the trigger. 2. Update a single column value. 3. Unblock the trigger - > Save the table. I am thinking on how could I detect the changes from my C# application. Thanks once again for your valuable input.

          Thanks Md. Marufuzzaman


          I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          I think your app would need to hold a copy of the table and constantly compare, and I doubt that's worth the trouble, so don't bother trying. You can't protect against a malicious authorized user. There are also times when you legitimately want to correct some data and make it appear to have always been correct. In my opinion, an app should never hold onto data for longer than it needs it; when it needs the data again it should query it again.

          1 Reply Last reply
          0
          • M Md Marufuzzaman

            Hi guys, I am looking for the best ways to create an api which will monitor the database table row version. if this api found any row update manually (i.e., directly login to SQL server) than it will send an acknowledgement with the following information: (1) LogIn detail of the data server. (2) Access database name with datatime. (3) Affected table name, row version and row number as well. I will be glad for your any suggestion / ides on that.

            Thanks Md. Marufuzzaman


            I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Doing a trace isn't the same as an intruder-protection, and those are both different from versioning a row. I'd suggest you create a fingerprint for the data. What are you trying to achieve/prevent exactly?

            Bastard Programmer from Hell :suss:

            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