日期:2014-05-18 浏览次数:20522 次
CREATE TRIGGER T_table ON dbo.table_t
FOR UPDATE
AS
if update(limit)
begin
    update table_t
    set LEVEL = case when limit >= 3000 then 'A' WHEN limit >=1000 then 'B' ELSE 'A' end
    from inserted i,deleted d
    where i.id = d.id
    and i.limit  <> d.limit 
    and i.id = table_t.id
end