1

I have a database which contains some tables such as article, news, projects,...

I want to save a record to another table (Activity) when a record inserted into each table in database without activity

I don't want to create a trigger for each table.

How can I do it?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
programmer
  • 83
  • 11

1 Answers1

1

If you were to use an intermediate layer, such as an ORM like Entity Framework, you could, in effect, have a "database wide" trigger, by overriding the OnSaveChanges event to add a log record anytime something is committed to the database.

My answer on This Question does exactly that

Community
  • 1
  • 1
Neil N
  • 24,862
  • 16
  • 85
  • 145