CREATE TRIGGER AInsertAffter ON A
FOR INSERT
AS
insert into C
value(表A.ID,'表A',表A.MoneyAmount)
Go
FOR INSERT
AS
insert into C
value(表A.ID,'表A',表A.MoneyAmount)
Go
解决方案 »
- 关于SQL复制的问题
- 求一查询检索的sql语句
- 求 SQL in 里面的变量查询 写法
- 如何可以高效使用MSSQL2000
- is nul 的判断跟isnull(,'')的判断有什么不同?
- web config?
- 因硬盘有坏道只拷出.mdf文件,而.ldf文件想尽办法出没拷出来,sp_attach_single_db好像不能导这个.mdf?请问怎么办?
- 存储过程调试时,我设了断点了,为什么运行时不会在断点处停下来,而是直接运行完呢?
- 大家快来看看看,一个奇怪的问题?asp连接sql问题?
- 我该怎么完成以下的select语句!谢谢!
- 关于查询速度很慢的问题
- 我架了FTP,但是我现在的文件有很多,但是文件就是有点乱了,现在我想用数据库来管理,但是我现在不知道怎么搞!谁会的,希望大家给我点
表C.ID=表A.ID 表C.TableTypeName = '表A' 对应的 表C.MoneyAmount也更新,表C.MoneyAmount=表A.MoneyAmount
如果表B.MoneyAmount发生变化了,那么相应的那条记录
表C.ID=表B.ID 表B.TableTypeName = '表B' 对应的 表C.MoneyAmount也更新,表C.MoneyAmount=表B.MoneyAmount
嗯,就是这样,请邹建老大帮帮忙。
for update
as
update c set C.MoneyAmount=A.MoneyAmount
from 表C c,inserted A
where a.id=b.id and C.TableTypeName = '表A'
go
create trigger tr_update_表B on 表B
for update
as
update c set C.MoneyAmount=A.MoneyAmount
from 表C c,inserted B
where a.id=b.id and C.TableTypeName = '表B'
go
for update
as
update c set C.MoneyAmount=A.MoneyAmount
from 表C c,inserted A
where c.id=A.id and C.TableTypeName = '表A'
go
create trigger tr_update_表B on 表B
for update
as
update c set C.MoneyAmount=A.MoneyAmount
from 表C c,inserted B
where c.id=Bb.id and C.TableTypeName = '表B'
go