我想在每次往临时表tempR表中存入数据之前先把这个表中的所有数据清空,然后才插入数据,所以建立了这个触发器:create trigger 读者录入临时表触发器 on tempR
instead of insert
as
delete from tempR
当我向tempR表中插入一个数据时
insert into tempR values('u0041442')
却发现,这个触发器仅仅执行了删除操作却没有将'u0041442'插入到表tempR中,哪里出了错?表tempR结构:
create table tempR(
num char(8)
)
instead of insert
as
delete from tempR
当我向tempR表中插入一个数据时
insert into tempR values('u0041442')
却发现,这个触发器仅仅执行了删除操作却没有将'u0041442'插入到表tempR中,哪里出了错?表tempR结构:
create table tempR(
num char(8)
)
本身就是意思代替 原先 insert的操作
create trigger 读者录入临时表触发器 on tempR
instead of insert
as
begin
delete tempr
insert tempR select * from inserted
end
instead of insert
as
begin
delete tempr
insert tempR select * from inserted
end