title: How to create audit trail for a table using Triggers. I am using sybase 15.2 ASE
body: <p>Iwant to post all changes of records of table copied into a separate table</p>
  
  <pre><code>CREATE TABLE dbo.mytable(
      field1 numeric(13,2) NOT NULL,
      field2 char(4)       NOT NULL,
      field3 char(4)       NOT NULL,
      field4 varchar(30)   NOT NULL,
      field5         datetime      NULL,
      field6 datetime      NULL)
  </code></pre>
  
  <p>This is my table.</p>
  
  <p>I want to create a separate table, which will record, all changes, as and when changes to the above table..</p>
  
  <pre><code> CREATE TABLE dbo.mytable_audit(
              field1 numeric(13,2) NOT NULL,
              field2 char(4)       NOT NULL,
              field3 char(4)       NOT NULL,
              field4 varchar(30)   NOT NULL,
              field5         datetime      NULL,
              field6 datetime      NULL,
      idactivity numaric),
      iddatestamp datetime)
  </code></pre>
  
  <p>I want to capture changes of first table into 2nd table (who did insert/update/delete on this table with time stamp).</p>