一、导入到 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 


 

 


相关文章:

  • 2022-12-23
  • 2022-01-20
  • 2021-06-01
  • 2021-04-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
猜你喜欢
  • 2022-01-27
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2021-10-16
  • 2022-01-08
  • 2021-09-24
相关资源
相似解决方案