我有三个表:SQL触发维护修改历史
Table1: Customers (CustomerId, Name, CustomerAddress)
Table2: AccountManagers(ManagerId, Name)
Table3: CustomerAccountManagers (CustomerId, ManagerId, Remarks)
Table4: CustomerHistory(CustomerAddress, ManagerId, Date)
的CustomerHistory表用于存储作出“CustomerAddress”或“经理ID”例如CustomerAddress从“地址1”更新任何变化“地址2“或者CustomerAccountManager从”Manager1“更改为”Manager2“。
我需要通过SQL触发器将更改存储在CustomerHistory表中。问题是,我应该在哪张桌子上放置触发器?请注意,这些更改同时对“客户”&“CustomerAccountManagers”这两个表进行。
感谢
您可能会发现谷歌搜索技术实现4型渐变维度有益的(见不同类型在这里 - http://en.wikipedia.org/wiki/Slowly_changing_dimension) –