Reputation: 83
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?
Upvotes: 1
Views: 310
Reputation: 25258
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
Upvotes: 1