declare @oldAcMastID varchar(40),@NewAcMastID varchar(40) set @oldAcMastID ='1224' set @NewAcMastID ='1228' --begin tran -------update AcMast set AcMastId = @NewAcMastID where AcMastId = @oldAcMastID --IF @@ERROR <> 0 -- ROLLBACK TRAN --else --begin Update AcAct set AcSuperId = @NewAcMastID where AcSuperId = @oldAcMastID Update AcActiveState set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update AcActiveState set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update AcExtra set AcSubBaseId = @NewAcMastID where AcSubBaseId = @oldAcMastID Update AcExtra set AcSubParentId = @NewAcMastID where AcSubParentId = @oldAcMastID Update AcExtra set CollectorAcId = @NewAcMastID where CollectorAcId = @oldAcMastID Update AcExtra set CollectorSubId = @NewAcMastID where CollectorSubId = @oldAcMastID Update AcExtra set DpAcmastId = @NewAcMastID where DpAcmastId = @oldAcMastID Update AcExtra set DpAcParentId = @NewAcMastID where DpAcParentId = @oldAcMastID Update AcFreezeMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update AcFreezeMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update AcHdExtra set TDSAcmastId = @NewAcMastID where TDSAcmastId = @oldAcMastID Update AcLinkHasSub set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update AcList set AcParentId = @NewAcMastID where AcParentId = @oldAcMastID Update AcMast set AcParentId = @NewAcMastID where AcParentId = @oldAcMastID Update AcMast set AcSuperId = @NewAcMastID where AcSuperId = @oldAcMastID Update AcMast set BID = @NewAcMastID where BID = @oldAcMastID Update AcMast set RefAcmastId = @NewAcMastID where RefAcmastId = @oldAcMastID Update AcMast set RefAcSubId = @NewAcMastID where RefAcSubId = @oldAcMastID Update AcPermission set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update AcRefDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update AcRefDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update AcRefMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update AcRefMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update AcRent set RentAcmastId = @NewAcMastID where RentAcmastId = @oldAcMastID Update BcCharge set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update BcCharge set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BcDrawee set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update BcDrawee set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BcDrawer set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update BcDrawer set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BcTrack set CrAcHeadId = @NewAcMastID where CrAcHeadId = @oldAcMastID Update BcTrack set CrAcMastId = @NewAcMastID where CrAcMastId = @oldAcMastID Update BcTrack set CrAcSubId = @NewAcMastID where CrAcSubId = @oldAcMastID Update BcTrack set DrAcHeadId = @NewAcMastID where DrAcHeadId = @oldAcMastID Update BcTrack set DrAcMastId = @NewAcMastID where DrAcMastId = @oldAcMastID Update BcTrack set DrAcSubId = @NewAcMastID where DrAcSubId = @oldAcMastID Update BcUtilisationCharge set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update BcUtilisationCharge set AcsubId = @NewAcMastID where AcsubId = @oldAcMastID Update BillAdd set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update BillAdd set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BillDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update BillDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BillExtra set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update BillExtra set CollectorAcId = @NewAcMastID where CollectorAcId = @oldAcMastID Update BillExtra set CollectorSubId = @NewAcMastID where CollectorSubId = @oldAcMastID Update BillExtra set ConAcmastId = @NewAcMastID where ConAcmastId = @oldAcMastID Update BillGoods set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Billmast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update Billmast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Billmast set DescAcMastId = @NewAcMastID where DescAcMastId = @oldAcMastID Update Billmast set DescAcSubId = @NewAcMastID where DescAcSubId = @oldAcMastID Update BillOp set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BillPayMode set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update BillPayMode set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BillTerm set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update BillTerm set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BillTypeSet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update BillTypeSet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BillTypeSet set RoundHeadId = @NewAcMastID where RoundHeadId = @oldAcMastID Update BillTypeSet set ToACMASTID = @NewAcMastID where ToACMASTID = @oldAcMastID Update BillTypeSet set ToACSUBID = @NewAcMastID where ToACSUBID = @oldAcMastID Update BillTypeSet set ToTRADEID = @NewAcMastID where ToTRADEID = @oldAcMastID Update BillTypeSet set TRADEID = @NewAcMastID where TRADEID = @oldAcMastID Update BmMem set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update BmMem set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BrVoDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update BrVoDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update BrVoDet set HomeAcHeadId = @NewAcMastID where HomeAcHeadId = @oldAcMastID Update BrVoDet set HomeAcmastId = @NewAcMastID where HomeAcmastId = @oldAcMastID Update BrVoDet set HomeAcSubId = @NewAcMastID where HomeAcSubId = @oldAcMastID Update CCClHouseMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update CCClHouseMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update CCTrack set CrAcHeadId = @NewAcMastID where CrAcHeadId = @oldAcMastID Update CCTrack set CrAcMastID = @NewAcMastID where CrAcMastID = @oldAcMastID Update CCTrack set CrAcSubId = @NewAcMastID where CrAcSubId = @oldAcMastID Update CCTrack set DrAcHeadID = @NewAcMastID where DrAcHeadID = @oldAcMastID Update CCTrack set DrAcMastId = @NewAcMastID where DrAcMastId = @oldAcMastID Update CCTrack set DrAcSubId = @NewAcMastID where DrAcSubId = @oldAcMastID Update ChargeConfig set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ChargeConfig set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update ConfigMast set AcSuperID = @NewAcMastID where AcSuperID = @oldAcMastID Update ConfigMastForBranch set AcSuperID = @NewAcMastID where AcSuperID = @oldAcMastID Update ConsABillM set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ConsABillM set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update ConsABills set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update ConsRefDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ConsRefDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update ConsRefM set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ConsRefM set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update CqOpMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update CQTr set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update CQTr set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update CQTrack set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update CQTrack set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update DcTrackDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update DcTrackMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Deposit set RnwAcmastId = @NewAcMastID where RnwAcmastId = @oldAcMastID Update Deposit set RnwAcSubId = @NewAcMastID where RnwAcSubId = @oldAcMastID Update DispMast set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update DispTrack set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update DocTr set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update DocTr set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update DODet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update DODet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update DOMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update DOMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update DOTerm set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update DOTerm set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update DrawCCLDet set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update DrawCCLMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update DrawCCLMast set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update ElementAc set AcSuperID = @NewAcMastID where AcSuperID = @oldAcMastID Update ElementAc set VoAcmastID = @NewAcMastID where VoAcmastID = @oldAcMastID Update ElementApply set AcSuperID = @NewAcMastID where AcSuperID = @oldAcMastID Update Form39Mast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update Form39Mast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update FormN2Mast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update FormN2Mast set AcsubId = @NewAcMastID where AcsubId = @oldAcMastID Update GoodsAdd set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update GoodsAdd set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update GoodsDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update GoodsDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update GoodsMast set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update GoodsMast set AcsubId = @NewAcMastID where AcsubId = @oldAcMastID Update GoodsTerm set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update GoodsTerm set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update GoodsTrack set AcsubId = @NewAcMastID where AcsubId = @oldAcMastID Update GoodsTrackDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update GoodsTrackMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update GRNTRACKDET set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update GRNTRACKMAST set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update HrAcExtra set CrAcMastID = @NewAcMastID where CrAcMastID = @oldAcMastID Update HrAcExtra set CrAcSubID = @NewAcMastID where CrAcSubID = @oldAcMastID Update InsuMast set FactAcMastId = @NewAcMastID where FactAcMastId = @oldAcMastID Update InsuMem set FactAcMastId = @NewAcMastID where FactAcMastId = @oldAcMastID Update IntTran set AcParentId = @NewAcMastID where AcParentId = @oldAcMastID Update IntTran set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update istdet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update istdet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update istmast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update istmast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update istmast set DescAcMastId = @NewAcMastID where DescAcMastId = @oldAcMastID Update istmast set DescAcSubId = @NewAcMastID where DescAcSubId = @oldAcMastID Update ItMast set pAcmastid = @NewAcMastID where pAcmastid = @oldAcMastID Update ItMast set pAcsubid = @NewAcMastID where pAcsubid = @oldAcMastID Update ItMast set pRtnAcmastid = @NewAcMastID where pRtnAcmastid = @oldAcMastID Update ItMast set pRtnAcsubid = @NewAcMastID where pRtnAcsubid = @oldAcMastID Update ItMast set sAcmastid = @NewAcMastID where sAcmastid = @oldAcMastID Update ItMast set sAcsubid = @NewAcMastID where sAcsubid = @oldAcMastID Update ItMast set sRtnAcmastId = @NewAcMastID where sRtnAcmastId = @oldAcMastID Update ItMast set sRtnAcsubid = @NewAcMastID where sRtnAcsubid = @oldAcMastID Update ItMast set tpAcmastid = @NewAcMastID where tpAcmastid = @oldAcMastID Update ItMast set tpAcsubid = @NewAcMastID where tpAcsubid = @oldAcMastID Update ItMast set tsAcmastid = @NewAcMastID where tsAcmastid = @oldAcMastID Update ItMast set tsAcsubid = @NewAcMastID where tsAcsubid = @oldAcMastID Update ItRef_F set ItAcmastId = @NewAcMastID where ItAcmastId = @oldAcMastID Update ItRef_F set ItAcSubId = @NewAcMastID where ItAcSubId = @oldAcMastID Update ItRefDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ItRefDet set acsubid = @NewAcMastID where acsubid = @oldAcMastID Update ItRefDet set itAcHeadId = @NewAcMastID where itAcHeadId = @oldAcMastID Update ItRefDet set ItAcmastId = @NewAcMastID where ItAcmastId = @oldAcMastID Update ItRefDet set ItAcSubId = @NewAcMastID where ItAcSubId = @oldAcMastID Update ItRefMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ItRefMast set Acsubid = @NewAcMastID where Acsubid = @oldAcMastID Update ItRefTerm set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ItRefTerm set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update LimitCCLDet set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update LimitCCLMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update LimitCCLMast set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update LnAddsancM set AcParentId = @NewAcMastID where AcParentId = @oldAcMastID Update LnInsuMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update LnInsuMast set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update LnVerifyDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update LnVerifyMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update MandiAdd set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update MandiAdd set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update MandiDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update MandiDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update MandiMast set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update MandiMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update MandiMast set DescAcMastId = @NewAcMastID where DescAcMastId = @oldAcMastID Update MandiMast set DescAcSubId = @NewAcMastID where DescAcSubId = @oldAcMastID Update MandiTrade set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update MandiTrade set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update MeetingMast set AcParentId = @NewAcMastID where AcParentId = @oldAcMastID Update Mkt_OrdDet set VoAcHeadID = @NewAcMastID where VoAcHeadID = @oldAcMastID Update Mkt_OrdDet set VoAcMastID = @NewAcMastID where VoAcMastID = @oldAcMastID Update Mkt_OrdDet set VoAcSubID = @NewAcMastID where VoAcSubID = @oldAcMastID Update NcpDet set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update NcpDet set AcSubID = @NewAcMastID where AcSubID = @oldAcMastID Update NoticeAct set AcSuperID = @NewAcMastID where AcSuperID = @oldAcMastID Update NoticeTrDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update NoticeTrDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update NoticeTrMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update NoticeTrMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update NoticeTrMast set DrAcHeadId = @NewAcMastID where DrAcHeadId = @oldAcMastID Update NoticeTrMast set DrAcmastId = @NewAcMastID where DrAcmastId = @oldAcMastID Update NoticeTrMast set DrAcSubId = @NewAcMastID where DrAcSubId = @oldAcMastID Update NoticeTrMast set MAcHeadId = @NewAcMastID where MAcHeadId = @oldAcMastID Update NoticeTrMast set MAcmastId = @NewAcMastID where MAcmastId = @oldAcMastID Update NoticeTrMast set MAcSubId = @NewAcMastID where MAcSubId = @oldAcMastID Update OrderMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update OrderMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update OrdtrackMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update OrgBrMast set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update OrgBrMast set AcSubID = @NewAcMastID where AcSubID = @oldAcMastID Update PartyMast set MemHdId = @NewAcMastID where MemHdId = @oldAcMastID Update PartyMast set MemId = @NewAcMastID where MemId = @oldAcMastID Update PaySalTrDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update PBookTran set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update PBookTran set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update PledgeDP set DpAcHeadId = @NewAcMastID where DpAcHeadId = @oldAcMastID Update PledgeDP set DpAcSubId = @NewAcMastID where DpAcSubId = @oldAcMastID Update PledgeDP set InacheadId = @NewAcMastID where InacheadId = @oldAcMastID Update PledgeDP set InacsubId = @NewAcMastID where InacsubId = @oldAcMastID Update PledgeDP set RenvAcmastId = @NewAcMastID where RenvAcmastId = @oldAcMastID Update PledgeLN set LnAcHeadId = @NewAcMastID where LnAcHeadId = @oldAcMastID Update PledgeLN set LnAcSubId = @NewAcMastID where LnAcSubId = @oldAcMastID Update PledgePL set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update PledgePLDet set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update PmcDet set AcHeadid = @NewAcMastID where AcHeadid = @oldAcMastID Update PmcDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update PmcDet set CollectorAcId = @NewAcMastID where CollectorAcId = @oldAcMastID Update PmcDet set CollectorSubId = @NewAcMastID where CollectorSubId = @oldAcMastID Update POAdd set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update POAdd set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update PODet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update PODet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update POMast set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update POMast set AcsubId = @NewAcMastID where AcsubId = @oldAcMastID Update PORefDet set acsubid = @NewAcMastID where acsubid = @oldAcMastID Update PORefDet set itAcHeadId = @NewAcMastID where itAcHeadId = @oldAcMastID Update PORefDet set ItAcmastId = @NewAcMastID where ItAcmastId = @oldAcMastID Update PORefDet set ItAcSubId = @NewAcMastID where ItAcSubId = @oldAcMastID Update PoRefMast set Acsubid = @NewAcMastID where Acsubid = @oldAcMastID Update PORefTrack set AcsubId = @NewAcMastID where AcsubId = @oldAcMastID Update PoTerm set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update PoTerm set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update ProvTrDet set BalsheetAcMastID = @NewAcMastID where BalsheetAcMastID = @oldAcMastID Update ProvTrDet set BalsheetAcSubID = @NewAcMastID where BalsheetAcSubID = @oldAcMastID Update ProvTrDet set IncomeExpAcMastID = @NewAcMastID where IncomeExpAcMastID = @oldAcMastID Update ProvTrDet set IncomeExpAcSubID = @NewAcMastID where IncomeExpAcSubID = @oldAcMastID Update ProvTrMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ProvTrMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update ProvTrMast set DescAcMastId = @NewAcMastID where DescAcMastId = @oldAcMastID Update ProvTrMast set DescAcSubId = @NewAcMastID where DescAcSubId = @oldAcMastID Update QuotDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update QuotDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update QuotDet set ItAcMastId = @NewAcMastID where ItAcMastId = @oldAcMastID Update QuotDet set ItAcSubId = @NewAcMastID where ItAcSubId = @oldAcMastID Update QuotMast set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update QuotMast set AcsubId = @NewAcMastID where AcsubId = @oldAcMastID Update QuotTerm set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update QuotTerm set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update RateListAssign set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update RentMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update RentMast set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update RepAcLinkDet set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update RepItemDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update RepItemDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update RPayDet set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update RPayMast set AcParentId = @NewAcMastID where AcParentId = @oldAcMastID Update RPayMast set FactAcmastId = @NewAcMastID where FactAcmastId = @oldAcMastID Update SalAllowAc set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update SalAllowAc set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update SalDeductAc set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update SalDeductAc set AcSubID = @NewAcMastID where AcSubID = @oldAcMastID Update SecurityOut set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ShgCircle set AnimatorAcHeadId = @NewAcMastID where AnimatorAcHeadId = @oldAcMastID Update ShgCircle set AnimatorAcSubId = @NewAcMastID where AnimatorAcSubId = @oldAcMastID Update ShgCircle set SuperWiserAcHeadId = @NewAcMastID where SuperWiserAcHeadId = @oldAcMastID Update ShgCircle set SuperWiserAcSubId = @NewAcMastID where SuperWiserAcSubId = @oldAcMastID Update ShrCertiIssue set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update ShrCertiIssue set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update StInstMast set CrAcHeadId = @NewAcMastID where CrAcHeadId = @oldAcMastID Update StInstMast set CrAcmastId = @NewAcMastID where CrAcmastId = @oldAcMastID Update StInstMast set CrAcSubId = @NewAcMastID where CrAcSubId = @oldAcMastID Update StInstMast set DrAcHeadId = @NewAcMastID where DrAcHeadId = @oldAcMastID Update StInstMast set DrAcmastId = @NewAcMastID where DrAcmastId = @oldAcMastID Update StInstMast set DrAcSubId = @NewAcMastID where DrAcSubId = @oldAcMastID Update StockTrDet set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update StockTrDet set AcSubID = @NewAcMastID where AcSubID = @oldAcMastID Update Surity set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update Surity set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update TermMast set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update TermMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Tradeconfig set TradeHeadId = @NewAcMastID where TradeHeadId = @oldAcMastID Update Tradeconfig set TradeSubId = @NewAcMastID where TradeSubId = @oldAcMastID Update Tradeconfig set VatHeadId = @NewAcMastID where VatHeadId = @oldAcMastID Update TradeItConfig set AcheadId = @NewAcMastID where AcheadId = @oldAcMastID Update TradeItConfig set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Trig_CurAc set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update Trig_CurAcRef set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Trig_CurCons set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Trig_CurDc set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Trig_CurGrn set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Trig_CurSubAc set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update Trig_CurSubAc set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update Trig_DayAc set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update UserConfig set AcSuperID = @NewAcMastID where AcSuperID = @oldAcMastID Update UserConfigForBranch set AcSuperID = @NewAcMastID where AcSuperID = @oldAcMastID Update VatClass set AccountGrpId = @NewAcMastID where AccountGrpId = @oldAcMastID Update VatClass set inputTaxAcmastid = @NewAcMastID where inputTaxAcmastid = @oldAcMastID Update VatClass set inputTaxAcSubid = @NewAcMastID where inputTaxAcSubid = @oldAcMastID Update VatClass set outputTaxAcmastid = @NewAcMastID where outputTaxAcmastid = @oldAcMastID Update VatClass set outputTaxAcsubid = @NewAcMastID where outputTaxAcsubid = @oldAcMastID Update VoAssetDet set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update VoAssetDet set AcSubID = @NewAcMastID where AcSubID = @oldAcMastID Update VoDepoDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update VoDepoDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update VoDepoRef set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update VoDepoRef set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update VoInsuDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update VoInsuDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update VoLnUsedDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update VoLoanDet set AcHeadID = @NewAcMastID where AcHeadID = @oldAcMastID Update VoLoanDet set AcSubID = @NewAcMastID where AcSubID = @oldAcMastID Update VoMast set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update VoMast set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update VoRentDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update VoRentDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update VoSalDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update VoSalDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update VoShareDet set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update VoShareDet set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update VoterMast set AcParentId = @NewAcMastID where AcParentId = @oldAcMastID Update voucher set AcHeadId = @NewAcMastID where AcHeadId = @oldAcMastID Update voucher set AcSubId = @NewAcMastID where AcSubId = @oldAcMastID Update voucher set AcMastId = @NewAcMastID where AcMastID = @oldAcMastID Update voucher set DescAcMastId = @NewAcMastID where DescAcMastId = @oldAcMastID Update voucher set descAcSubId = @NewAcMastID where descAcSubId = @oldAcMastID Update VoMast set acmastid = @NewAcMastID where acmastid = @oldAcMastID Update billop set acmastid = @NewAcMastID where acmastid = @oldAcMastID Update VoLoanDet set acmastid = @NewAcMastID where acmastid = @oldAcMastID