create trigger tr_insert on 表
for insert
as
if exists(select * from inserted where TAX is null)
update 表 set TAX=0 from 表 a,inserted i where a.id=i.id
for insert
as
if exists(select * from inserted where TAX is null)
update 表 set TAX=0 from 表 a,inserted i where a.id=i.id
解决方案 »
- 求sql語句
- 如何将MySQL数据迁移到SQLServer中
- sql select into 到临时表顺序问题
- 关于SQL中类似于 instr的函数
- Sqlserver2005性能问题
- 一个神奇的错误
- 低分问个弱智的问题select @dt_j=1 select @dt_i=5这两句话,能不能写成select @dt_j=1,@dt_i=5
- 我写了一个.net的程序,运行一段时候后,sqlserver占cpu的资源就达到了92%以上
- 请问在Sql Server中 NULL 和 '' 相同吗?
- 在自己的应用程序中如何及时获得数据库中数据被修改的信息? (在线等候)
- 哪有繁体版的MSDE下载?????
- GO语句怎么用?
for insert
as
if exists(select * from inserted where TAX is null)
update 表 set TAX=0 from 表 a,inserted i where a.id=i.id and i.TAX is null
for insert
as
if exists(select * from inserted where TAX is null)
update 表 set TAX=0 from 表 a,inserted i where a.id=i.id and i.TAX is null