导出数据为excel:
EXEC master..xp_cmdshell
'bcp fsebss.dbo.Resource_GoodsType out c:/temp1.xls -c -q -S"YYSOFT-468ER27V(sql服务器名称)"
-U"sa(登录名)" -P"111111(密码)"'
从excel中导入数据:
insert into VPMN_BaseInforList_ML(BI_BaseShopNo,BIL_BaseShopListNo,BIL_Name,BIL_Jobs,BIL_Tel)
SELECT (left(成员编号,11)) '合作商编号',(left(成员编号,11)+right(成员编号,3)) '成员编号',姓名,职位,convert(varchar(50),手机号码,120)
FROM OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="c:/pp.xls";
User ID=Admin;Password=;Extended properties=Excel 8.0')...[sheet2$] where 姓名 is not null