1、view可以简化语句,可以保护实际的表。。你的代码写错了吧:
create view 视图名 as select * from 你的表2、是在test1建立triggerCREATE TRIGGER 名 ON table1
FOR update
AS
update table2 set 列=inserted.列 from inserted where inserted.id=table2.id
create view 视图名 as select * from 你的表2、是在test1建立triggerCREATE TRIGGER 名 ON table1
FOR update
AS
update table2 set 列=inserted.列 from inserted where inserted.id=table2.id
Create view 视图名
as
Select * from a Join b on a.Key = b.Key left join c on a.key = c.key
where 1=1 and c.Field2 = 02:当然是在table1上建Trigger
Create trigger yourTriggerName on Table1
For Update
As
update table2 set 列=inserted.列
from table2 join inserted on inserted.key=table2.key
where 1=1 and c.Field2 = 0
这句中1=1我不懂﹐能解释一下吗﹐谢谢﹗
举一例子好了 有表test1(a int,b char,c char)
表test2 (a int,d int ,f char ,i int)
試問
1﹕以test2建立视图appview,并另加一计算字段sum=a*i/d
2: 更新test1时自动将test2之f字段设为'yes'