Home > Database > Mysql Tutorial > Excel导入Sqlserver数据库脚本

Excel导入Sqlserver数据库脚本

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:59:19
Original
1091 people have browsed it

简单但很实用的一段SQL脚本,相信大家在做新旧系统升级时会经常用到.

受以前旧同事之托,在博客里发这段脚本:

exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

SELECT * INTO tmp_asset
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=d:\Excel数据源\资产印章.xls',
'SELECT * FROM [Sheet1$]') ;

说明:

d:\Excel数据源\资产印章.xls ---------> 为文件存放的物理路径.

FROM [Sheet1$] ----------> 其中的Sheet1为工作表的名称.

剩下的就是对tmp_asset相关的列进行一些数据匹配了,这里就不多说了:)
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template