欢迎光临
我们一直在努力

F22触发器开关 触发器暂停、修改.txt 下载 转存

1.sql触发器查看
use F22_1
go
select * from sysobjects where xtype='TR'

2.sql触发器内容查看
exec sp_helptext 'TiudG_indentsub'

3.数据更改
update d_Indentsub
set clothingid=SUBSTRING(clothingid,1,9)+'13'+RIGHT(clothingid,2)
where SUBSTRING(clothingid,10,2)<>colorid
and styleid='A129849S1'
and indentid='DH2045-2010-12-15-0002'
select indentid from d_indentsub
where SUBSTRING(clothingid,10,2)<>colorid
and styleid='A129849S1'
group by indentid

 

 

 

 

发货价不等于配货价问题处理
/*修改已经审核登帐的发货单,但必须没有收货,要求没有人有配发货的时候才能关触发器*/
/*关闭触发器,第二步不可以才要停触发器*/
ALTER TABLE d_sell DISABLE TRIGGER Tu_sell
/* sellid=’发货单号’,有多少个就执行多少次,全部改完之后再做下步*/
update d_sell set setchk_sure = 0 where sellid =''
Udate d_sell set set_sure = 0 where sellid = ''

/*如果有已审未登的单据,最好先反审后再执行/
update b set b.phs_price=isnull(c.s_price,0)
from (select sellid,quotaid from d_sell where setchk_sure_sure = 0 and set_sure = 0
and isnull(quotaid,'')<>'') a,
d_sellsub b,d_quotasub c
where a.sellid=b.sellid and isnull(b.phs_price,0)=0 and a.quotaid=c.quotaid and b.clothingid=c.clothingid

/*开启触发器*/
ALTER TABLE d_sell ENABLE TRIGGER Tu_sell

赞(0)
未经允许不得转载:福利吧|福利社|fuliba » F22触发器开关 触发器暂停、修改.txt 下载 转存

相关推荐

  • 暂无文章