청강컴정/DataBase

업데이트 트리거

luckey 2009. 5. 4. 17:31

create trigger TRG_CAFE_UPDATE on cafe
for update
as
begin
 if update(name)
 begin
  update cafe
  set description = '반갑습니다. ' + name + '입니다.'
  where sn = (select sn from inserted)
 end
end

update cafe set name = '교대피플' where name = '교대People'