title: How do I detect whether a table has had rows added or removed outside my application?
body: <p>This is a specific scenario. What I need to achieve is this:</p>
  
  <ol>
  <li>If someone insert or delete one or more rows in a specified table
  outside my application's UI, then it should detect that the table
  was modified.</li>
  <li>It should <strong>not</strong> use triggers.</li>
  </ol>
  
  <p>This is what it <strong>not</strong> need to do:</p>
  
  <ol>
  <li>Differentiate if it was deleted or inserted.</li>
  <li>Detect <strong>who</strong> did the alteration or <strong>where</strong> it was altered.</li>
  <li>If the user do the same number of inserts and deletes at the same time. That can technically be counted as alterations and so, don't need to be detected as inserts and deletes.</li>
  </ol>
  
  <p>This is what we think could do the job:
    Create a table that will store the watched table name, the number of rows it have and a validation key, let's call <code>integrity_tbl</code>. After inserts or deletes, update the number of rows and validation key. Only update the count of rows if validation key is valid. Invalidate the validation key every time the comparison fails. When data integrity verification is needed, count rows in table and compare to <code>integrity_tbl</code>.</p>
  
  <p>Do you think this is a good approach or should we try something else?</p>
  
  <p>We are using Delphi and Firebird for this.
  As asked, we are using IBX to connect to Database. But the logic is the problem not the way to access the database.</p>