读书人

触发器IF update后的语句操作对象是更

发布时间: 2011-12-30 23:30:45 作者: rapoo

触发器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

读书人网 >SQL Server

热点推荐