A表
A列 int
B列 int如果在插入过程中A列的值大于9,则B列自动为1.此时A列清0;
A列 int
B列 int如果在插入过程中A列的值大于9,则B列自动为1.此时A列清0;
解决方案 »
- 大数据库还原问题-在线等
- 请教ROY_88权限问题
- sql生成报表语句,有难度
- 我在查询分析器里执行一个存储过程,系统提示警告,请问什么原因引起了?
- sql server 2005 如何删除扩展存储过程xp_cmdshell
- 高分寻求Sql2000的开发环境下载!100分哟!
- distinct小问题?
- 一个SQL语句的构建,请大家帮忙出主意,分数不够可以再加
- 我刚刚发的贴为什么不见了?只能再发一贴了。如何检测SQL SERVER 2000中某个表是否存在?
- SYBASE下建视图不能使用union吗?
- 求一个sql语句
- 关于表变量和临时表返回结果集的问题,tomcat报错:“该语句没有返回结果集”
on tb
instead of insert
as
if exists(select 1 from inserted where a>9)
begin
insert tb(a,b)
select 0,1
from inserted
where a>9
end
on tb
instead of insert
as
if exists(select 1 from inserted where a>9)
begin
insert tb(a,b)
select 0,1 from inserted where a>9
union all
select a,b from inserted where a<=9
end
else
insert tb select a,b from insertedgo
on tb
instead of insert
as
insert tb(a,b)
select 0,1
from inserted
where a>9 insert tb(a,b) select a,b from inserted
where not (a>9)
go
create trigger tri_insert_tb
on tb
for insert
as
update tb set
a=0,b=1
from tb,inserted i
where i.id=tb.id and i.a>9
go