0

I have created table by following

CREATE TABLE MyTable (
`MyTable_ID`  int UNSIGNED NOT NULL AUTO_INCREMENT ,
CreationDate  datetime NULL , 
UpdateDate`  datetime NULL ,
PRIMARY KEY (`MyTable_ID`)
);

Here I have 2 columns CreationDate and UpdateDate.

I want to write only one trigger for both update and insert operation to update/ insert CreationDate, UpdateDate columns.

If I am doing

  1. insert operation I want to update CreationDate,UpdateDate columns
  2. if I am doing update operation I want to update only UpdateDate.

Thank you.

fancyPants
  • 50,732
  • 33
  • 89
  • 96

0 Answers0