MSSQL使用OpenRowSet函数导入EXCEL数据
2014-01-06 17:48
239 查看
使用前准备:
1.启用Ad Hoc Distributed Queries
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
2.关闭Ad Hoc Distributed Queries exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',1
reconfigure
--方法1:
select * from OpenRowSet('Microsoft.Jet.OLEDB.4.0','Excel 8.0;HDR=YES;DATABASE=d:/abc/t.xls', [sheet1$])
--方法2:
需要安装:AccessDatabaseEngine
地址:http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=23734
select * from OpenRowSet('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;HDR=Yes;IMEX=1;Database=c:/1.xls', [abc$])
1.启用Ad Hoc Distributed Queries
exec sp_configure 'show advanced options',1
reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure
2.关闭Ad Hoc Distributed Queries exec sp_configure 'Ad Hoc Distributed Queries',0
reconfigure
exec sp_configure 'show advanced options',1
reconfigure
--方法1:
select * from OpenRowSet('Microsoft.Jet.OLEDB.4.0','Excel 8.0;HDR=YES;DATABASE=d:/abc/t.xls', [sheet1$])
--方法2:
需要安装:AccessDatabaseEngine
地址:http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=23734
select * from OpenRowSet('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;HDR=Yes;IMEX=1;Database=c:/1.xls', [abc$])
相关文章推荐
- sqlite的一个Unable to Open database file的坑爹错误
- SQL Server无法以local 登陆问题的解决方法provider: Named Pipes Provider, error: 40 - Could not open a connection
- 使用Oracle SQLDeveloper连接数据库并创建用户
- MySQL server has gone away 的解决方法
- FAQ about OPEN and CLOSE Plsql Cursor in V$OPEN_CURSOR View (文档 ID 235291.1)
- 【环境配置】 geoserver、openlayers、PostgreSQL 开发环境配置
- mysql状态查看 QPS/TPS/缓存命中率查看
- PL/SQL Developer结合oracle精简客户端使用配置
- MySQL连接Hibernate配置properties文件内容
- DBCC大全集之(适用版本MS SQLServer 2008 R2)----DBCC USEROPTIONS返回当前连接的活动(设置)的 SET 选项
- Interpreting Raw SQL_TRACE output (文档 ID 39817.1)
- 【MySQL运维】MySQL5.1升级到MySQ 5.5实战 推荐
- centos定时备份web工程和sql文件并上传到ftp
- 在64位系统使用PLSQL Developer
- 高性能Mysql主从架构的复制原理及配置详解
- PL/SQL Developer导入和导出数据库
- Linux下SQL Developer 4.0 安装
- google-perftools 加速MySQL – TCMalloc
- django 配置mysql错误:Error was: No module named mysql.base
- oracle sql developer打开后,没有界面,如图