--在表中添加两个字段“MC012入库日期”,“MC013出库日期”
select * into #A
from OPENROWSET
(
‘Microsoft.Ace.OleDb.12.0‘
,‘Excel 12.0;DATABASE=C:\Users\Administrator\Desktop\产品\5月库存20180707.xls‘
,‘SELECT * FROM [Sheet1$]‘
)
update #A
set MC012入库日期 = b.MC012,MC013出库日期 = b.MC013
from
#A as a
,TOPLED2015..INVMC as b
where a.品号 = b.MC001 and a.仓库 = b.MC002
select * from #A
原文地址:http://blog.51cto.com/gongxi/2137943
时间: 2024-10-31 03:07:10