惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
D
Docker
云风的 BLOG
云风的 BLOG
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
GbyAI
GbyAI
T
Tailwind CSS Blog
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
C
Check Point Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
阮一峰的网络日志
阮一峰的网络日志
小众软件
小众软件
N
Netflix TechBlog - Medium
B
Blog RSS Feed
腾讯CDC
aimingoo的专栏
aimingoo的专栏

博客园 - 巴山游子

JAVA内存泄露分析及解决 Java内存泄漏的排查总结 第一次有人把 5G 讲的这么简单明了 关于NB-IoT,没有比这篇更通俗易懂的啦! 使用SQL Server 2014 In-Memory 内存数据库时需要注意的地方 SQL Server Profiler:使用方法和指标说明 SQL Server 维护计划实现数据库备份(策略实战) SQL Server 连接问题圣经-命名管道 如何查看 exec sp_execute 10 XXX, XXXX的RPC事件 内容 图解HTTPS 常用 T_SQL 语句 淘宝前端技术巡礼 快速找出数据库的性能问题之:缺失索引 &无用的索引 网页设计师必备的35套图标(免费下载) SQL Mon 介绍 网站设计常用技巧收集 web 学习资源整理 web 页面上的工作流设计 CodeSmith 学习资料收集
使用SQL 脚本 导入 Excel 数据
巴山游子 · 2011-11-23 · via 博客园 - 巴山游子

 一、导入到 Mysql 数据库

     先将excel 文件另存为 *.csv 文件,然后执行下列命令。

 load data local infile "path.csv" into talble(col1,col2,col3,col4,...);

二、导入Sql Server 数据库

     首先需要开户 Ad Hoc Distributed Queries 选项,开户方法如下:

 exec sp_configure 'show advanced options',1 

reconfigure
exec sp_configure 'Ad Hoc Distributed Queries',1
reconfigure

然后执行:

SELECT * into newtable
FROM OpenDataSource'Microsoft.Jet.OLEDB.4.0', 'Data Source="F:\一页管理.xls";User ID=Admin;Password=;Extended properties=Excel 5.0')...[Sheet1$]  

 最后关闭 Ad Hoc Distributed Queries 选项

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

reconfigure