alter table RKD_MX add fg_up_time datetime null,fg_lsh varchar(30) null
alter table XSD_MX add fg_up_time datetime null,fg_lsh varchar(30) null
create index RKD_MX_FG_UP_TIME on RKD_MX(fg_up_time)
create index XSD_MX_FG_UP_TIME on XSD_MX(fg_up_time)
update RKD_MX set fg_up_time=getdate() where fg_up_time is null
update XSD_MX set fg_up_time=getdate() where fg_up_time is null
select (rtrim(K.CKBM)+rtrim(K.YPBM)+rtrim(K.SCPH)) as fg_lsh,(K.YPBM) as fg_bm,(Y.PZWH) as fg_pzwh,(Y.MC) as fg_ypm,(Y.GG) as fg_gg,(Y.SCCJ) as fg_cd,(Y.JLDW) as fg_dw,(K.KCSL) as fg_num,(K.SCPH) as fg_ph,(convert(varchar(10),K.YXQZ,102)) as fg_yxq,(convert(varchar(10),getdate(),102)) as fg_rq,'ԭʼ' as fg_jcdw into fg_up_yskc from (select CKBM,YPBM,SCPH,KCSL,YXQZ from KC_KCDTB) as K join (select BM,PZWH,MC,GG,SCCJ,JLDW from BM_YP where (BJ is null or BJ<>'*')) as Y on K.YPBM=Y.BM
alter table fg_up_yskc add fg_up_time datetime
create index fg_up_yskc_lsh on fg_up_yskc(fg_lsh)
