create
proc fteupload asselect
* into #FTE from dbo.BudgetData where obj_desc like '%FTE%'declare
@edtn integerselect
@edtn=max(gbedtn) from JDE_CRP.CRPDTA.F0902Z1INSERT
INTO JDE_CRP.CRPDTA.F0902Z1(
GBAID,GBCTRY,GBFY,GBLT,GBCO,GBEDUS,GBCTID,GBEDTN,GBAN01,GBAN02,GBAN03,GBAN04,GBAN05
,GBAN06,GBAN07,GBAN08,GBAN09,GBAN10,GBAN11,GBAN12,GBMCU,GBOBJ,GBSUB,GBUSER,GBPID,GBUPMJ,GBJOBN,GBUPMT,GBCRCX,GBCRCD,GBIST,GBFQ,GBSBL,GBPRGF,GBSBLT,GBAPYC)select
gmaid,'20' ,'12','H1',GMCO,'SQL','DEREK',row_number() OVER (ORDER BY GMAID)+@edtn as GBEDTN, Period_01,Period_02,Period_03,Period_04,Period_05,Period_06
,Period_07,Period_08,Period_09,Period_10,Period_11,Period_12, GMMCU,GMOBJ,GMSUB,'DEREK','SQL','111347','SQL-SERVER','120000','USD','USD','A','','','','',0from
#FTEleft
outer join jde_crp.crpdta.f0901 on substring(ltrim(objsub),1,5)=ltrim(gmobj) and ltrim(BU)= ltrim(gmmcu)where
gmaid is not null
No comments:
Post a Comment