引起了其它操作,先查看一下zztopp是否也有插入触发
解决方案 »
- 怎么将一个数据库的所有资料(包括存储过程等)导到另一个服务器上
- SOS!!江湖救急!!如何在字段中去除空格和别的看不见的字符?
- 请各位帮忙看一下这个储存过程
- 字符串查询问题
- sql2008导入excl时,提示文本被截断,无法导入
- sql server2008 打开导入导出向导出错
- 简单的问题,马上送分
- 如何用EXEC执行insert into books(id,name) values('test1','测试')
- 为什么在表中删除记录时他提示我“键列信息不足或不正确。更新影响到多行”
- 初学者的学习-9->SP_FULLTEXT_DATABASE
- SQL 数据导出时Excel某一列要求是文本格式,应如何设置?
- 请问条关于数据库效率的问题!
on tb1
after insert
as
declare @billcode varchar(12)
declare @paymethod varchar(5)
select @billcode=billcode ,@paymethod=paymethod from inserted
if @paymethod='7006'
begin
insert into zztopp(zz) select billcode from inserted
end
go
if object_id('tb') is not null drop table tb
create table ta ( a int,b int)
create table tb (c int)
go
create trigger t_ta on ta
for insert
as
begin
set nocount on
insert into tb select b from inserted where a=7006
set nocount off
end
go
insert into ta select 7006,8888
go
select * from ta
select * from tb
/*
a b
7006 8888c
8888
*/
ALTER TABLE zztopp DISABLE TRIGGER ALL
ALTER TABLE zztopp ENABLETRIGGER ALL
我想在tb1表有billcode跟paymethod字段,我想单插入paymethod值为7006是将billcode插入到zztopp表中,
按以下语句执行后如paymethod不为7006时tb1能插入,zztopp表没插入,但是如为7006时zztopp表是插入了,
但tb1表反而没插入,为什么呢? 这段文字我看的都头晕。。奇怪,怎么读起来就怎么不顺呢。 。是我理解错误了吗
”我想在tb1表有billcode跟paymethod字段,我想单插入paymethod值为7006是将billcode插入到zztopp表中,“