Excel到Sqlserver数据库 [英] Excel To Sqlserver Database

查看:86
本文介绍了Excel到Sqlserver数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我的数据库中有一些数据。





我想做什么我必须将表数据导入Excel,并在Excel表格中进行一些更改后,我需要根据Excel中的更改更新我的数据库。

解决方案

< pre lang =sql> SELECT * INTO RECIPENAMES FROM
openrowset ' Microsoft .Jet.OLEDB.4.0'' excel 8.0; imex = 1;
database = D:SQL Training\IMPORT \所有食谱13320.xls'
,[SHEET2


)T





注意:Recipenames将是您的表名,您将在其中插入数据,此代码适用于97-2003 excel表,即仅适用于xls文件。提到工作表名称。在运行查询时,请关闭excel表并运行。


为什么不使用SQL SERVER提供的IMPORT和EXPORT TOOL。

您可以在已安装SQL Server的驱动器中找到该工具,或者在

C:\Program Files \ Microsoft SQL Server \80\Tools\Binn\ dtswiz.exe。



它是SQL Server提供的数据转换服务


Hello,
I have some data in my database.


What i want to do is i have to import the table data to Excel and after doing some changes in Excel sheet i need to update my database according to the changes made in Excel.

解决方案

SELECT * INTO RECIPENAMES FROM
    openrowset('Microsoft.Jet.OLEDB.4.0','excel 8.0;imex=1;
    database=D:SQL Training\IMPORT\All recipes 13320.xls',[SHEET2


) T



Note: that Recipenames will be your table name where u gonna insert the data and this code is for 97-2003 excel sheet i.e only for xls files. mention the sheet name. while running the query please close the excel sheet and run.


Why Dont you Use the IMPORT and EXPORT TOOL provided with SQL SERVER.
The Tool probably you can find in the Drive you have Installed the SQL Server or in
"C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtswiz.exe.

Its a Data Transformation Service Provided with SQL Server


这篇关于Excel到Sqlserver数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆