create trigger tri_update on a for update
as
update b set id=inserted.id where b.id=deleted.id
go
as
update b set id=inserted.id where b.id=deleted.id
go
解决方案 »
- 问个sql语句
- sql server2000中执行sql语句时发现系统会在表名前自动加上“dbo.”,什么意思?(详见内容)
- sqlserver 批量计算年龄
- sql server 2008全文检索如何查询摘要
- 问一个关于SQL SERVER性能的问题
- ODBC 怎么访问多张表
- 用JSP实现RSS阅读器的抓取种子文件入库的问题
- |zyciis| 200分求:商品对比的时候N个商品是并排着的,那这样子的话要怎么来绑定他呢
- 求行列转换实现
- numeric错误
- 有谁比较清楚查询提示中option(fast n)的工作原理吗?多谢
- 为什么Microsoft Access数库中的ID不能自己跟新呢?请高手指点
if exists(select name from sysobjects where name='update_b' and type='tr')
drop trigger update_b
go
create trigger update_b
on a
with encryption
for update
as
update(id)
begin
DECLARE @id as char(4)
SELECT @id=id FROM inserted
UPDATE b
SET id=@id
from deleted
WHERE id=deleted.id
end
update(id),应是:
if update(id)