触发器IF update后的语句操作对象是更新前还是更新后???
ALTER trigger [dbo].[cleartest] on [dbo].[Call]
for update not for replication
as
if update(call_name)
begin
select * from call
end
select * from call得到的是更新前的表还是更新后的表???
------解决方案--------------------inserted 存放的是更新后的
------解决方案--------------------经过试验,表明,是更新后的。
------解决方案--------------------create table temp
(A varchar(50)
)
insert into temp
select 'A '
select * from temp
--
A
create trigger trigger_name on temp
for update
as
if update(A)
begin
select * from temp
end
go
update temp set A= 'bb '
-------
bb