江风: 【触发器】基础资料短代码{wy}

日志

/   已经公开 2010年3月11日 15:48

if exists(select * from sysobjects where name = 'trj_item_insert_update') drop trigger trj_item_insert_update
go
create trigger trj_item_insert_update
on t_item
for update ,insert
as
 if update(fshortnumber)
 begin
  if exists(select a.fshortnumber,count(a.fshortnumber)
  from t_item a inner join inserted b on a.fitemclassid =  b.fitemclassid and a.fshortnumber=b.fshortnumber
  group by a.fshortnumber
  having count(a.fshortnumber)>1)
  begin
   raiserror('基础资料短代码重复',16,1)
   rollback tran
  end
请登录后再发表评论以赚取更多积分
郑重声明:资讯 【江风: 【触发器】基础资料短代码{wy}】由 发布,版权归原作者及其所在单位,其原创性以及文中陈述文字和内容未经(企业库qiyeku.com)证实,请读者仅作参考,并请自行核实相关内容。若本文有侵犯到您的版权, 请你提供相关证明及申请并与我们联系(qiyeku # qq.com)或【在线投诉】,我们审核后将会尽快处理。
—— 相关资讯 ——