比如,当对表里的字段做修改时,忘记修改它的时间了.
因此,希望通过触发器,自动修改它的某个字段(该字段保存的是时间).create trigger UpTime
on table1
for Update
as
update table1 set field3 = getdate() where .....???不知道后面的where条件该怎样写了.table1里有一个主键,FID...
因此,希望通过触发器,自动修改它的某个字段(该字段保存的是时间).create trigger UpTime
on table1
for Update
as
update table1 set field3 = getdate() where .....???不知道后面的where条件该怎样写了.table1里有一个主键,FID...
on table1
for Update
as
update table1 set field3 = getdate() from inserted i where fid=i.fid
on table1
for Update
as
update table1 set field3 = getdate()
FROM INSERTED WHERE table1.COLNAME=INSERTED.COLNAME
on table1
for Update
as
update t1 set field3 = getdate()from table1 t1,inserted i on t1.FID=i.FID
create trigger UpTime
on table1
for Update
as
update table1 set field3 = getdate() from inserted i where table1.fid=i.fid