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

解决方案 »

  1.   

    select @i=i from news 这个地方开始用cursor
      

  2.   

    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
      

  3.   

    不明白楼的真正意图,可以借助Inserted、Deleted这两个表去更新数据的
      

  4.   

    是一个软件。用的是sql数据库。不是web页的。所以得用触发才可以