mssql触发怎么执行全部,现在只执行最后一条
mssql触发如何执行全部,现在只执行最后一条CREATE TRIGGER TCMap ON dbo.tblGameID1for update ASif updat
mssql触发如何执行全部,现在只执行最后一条
CREATE TRIGGER TCMap ON dbo.tblGameID1
for update AS
if update(Map)
begin
declare @m int
declare @s int
declare @i varchar(14)
select @i=i from news
select @s=s,@m=m from news where i = @i
if (@s>1000 AND @m=2)
begin
update news set t = 21,c = 100,y=100 where i = @i
return
end
end
[解决办法]select @i=i from news 这个地方开始用cursor
[解决办法]CREATE TRIGGER TCMap ON dbo.tblGameID1
for update AS
if update(Map)
begin
update news set t = 21,c = 100,y=100 where s>1000 and m=2
end
[解决办法]不明白楼的真正意图,可以借助Inserted、Deleted这两个表去更新数据的