首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

更新时间触发器,该如何解决

2013-04-20 
更新时间触发器多个SQL数据库同步数据汇总到一个数据库上,想采用更新时间字段datetime代替时间戳timestamp

更新时间触发器
多个SQL数据库同步数据汇总到一个数据库上,想采用更新时间字段datetime代替时间戳timestamp。
如何写个触发器 为每个表的增改更新时间字段,最后查询大于上一次最大更新时间的诗句。
[解决办法]
你两个触发器可以和起来写:
create Trigger Insert_UpdateNop_CustomerTime on Nop_Customer 
for Insert, Update
as
update Nop_Customer set [updateTime]=GETDATE() from inserted 
where Nop_Customer.CustomerID=inserted.CustomerID

这点没有压力的。放心好了

热点排行