表头数据导入

INSERT 
INTO mf_bom (prd_mark,BOM_NO,NAME,PRD_NO,UNIT,WH_NO,PRD_KND,QTY,DEP,VALID_DD,USR,CHK_MAN, CLs_DATE, CREATE_DD,EFF_DD,RECORD_DD,SPC)
SELECT distinct '',a.mrp_no+'->',p.name,p.prd_no,'1','001',p.knd,1,'0000',getdate(),'ADMIN','ADMIN',getdate(),getdate(),getdate(),getdate(),convert(varchar(255),p.spc)
from a03 a,prdt p
where a.mrp_no=p.prd_no

表体数据导入

insert into tf_bom(bom_no,itm,prd_no,prd_mark,id_no,name,wh_no,bom_id,unit,qty,qty_bas,eff_dd)
select a.mrp_no+'->',[序号],a.prd_no,'','',p.name,'0000','','1',1,1,getdate()
from a03 a,prdt p
where a.prd_no=p.prd_no  order by a.mrp_no,[序号]

更新表头

update t
set t.id_no=m.bom_no
from mf_bom m,tf_bom t
where m.bom_no=t.prd_no+'->'
最后修改:2026 年 10 月 22 日
如果觉得我的文章对你有用,请随意赞赏