求救,帮我写个触发器语句,种类越多越好
有Table3
lsh col1 col2
----------- ---------- ----------
1 13 aaa
2 3 bbb
3 3 ccc
4 4 ddd
和Table4
ol1 col2 col3
---------- ---------- ----------
13 aaa 3
3 bbb 35345L
3 ccc e
4 ddd asd
13 sssa NUsssL
想在Table3中建一个触发器
当修改Table3的col1时将Table4的col1也修改
我自己写了一个,在delphi里调用总是有问题
CREATE TRIGGER update1 ON [dbo].[Table3]
FOR UPDATE
AS
if update(col1)
update table4 set col1=(select inserted.col1 from inserted,deleted where inserted.lsh=deleted.lsh) where col1 in (select col1 from deleted)
不知道有没有其它的好的办法