alter trigger tri on classtb
for insert
as
declare @id intbegin
select @id=id from inserted if exists(select * from classtb where id=@id )
delete classtb where id =@id
end
for insert
as
declare @id intbegin
select @id=id from inserted if exists(select * from classtb where id=@id )
delete classtb where id =@id
end
解决方案 »
- 查询后按日期分组显示
- 请问哪位知道 Microsoft SQL Server 2005 (32位)各版本的报价?
- 这句SQL怎么写?好急!!!
- 求助后进先出算法
- 高手看看我写的触发器错在哪里啊?(急,在线等)
- 哪有64bit sql server的下载。
- 我的sa密码忘记了,我又没有其他用户,而且我的数据库里有很重要的数据,请问我怎样才能恢复它们?
- 求助,在线等.
- 如何在sql server 的查询分析器中用sql语句转到另一台机器上的数据库,同样了sql server的
- netbeans连接SQL Server2008 Express问题
- 关于复杂统计的问题!请赐教!
- 安装 sql server 2000出现错误!!!
as
begin
if exists(select 1 from inserted where 某字段 like '%指定字符串%')
rollback tran
end
go
instead of insert
as
/*
没有该字符传就插入,否则不处理。不需要插入后,再检查并删除。
*/
begin
insert into test
select *
from inserted
where charindex('你的字符串',colName)=0
end