如何将Excel文件转换为SQL Server2005中的数据库? [英] how to convert excel file into database in sql server2005?

查看:74
本文介绍了如何将Excel文件转换为SQL Server2005中的数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是金奈的Mohan Kumar.

我怀疑将excel文件转换为数据库表.
请任何知道如何执行此操作的人回复给我.

Mohan

Hi,

I am Mohan Kumar from Chennai.

I have doubt for convert the excel file into database table.
Please can anyone who knows how to do this reply to me.

Mohan

推荐答案

尝试此链接

链接1:[ ^ ]

链接2:[ ^ ]
try this link

Link 1:[^]

Link 2:[^]


您有两种方法.

1.简单易用的方法,即使用SQL Server提供的导入向导.

2.使用OPENROWSET命令.

You have two ways of doing it.

1. The easy and simple way i.e to use the Import Wizard provided by the SQL Server.

2. Use the OPENROWSET command.

INSERT INTO [tableName] ([C1], [C2], [C3], [C4])  
SELECT DB.[C1], DB.[C2], DB.[C3], DB.[C4] 
FROM OPENROWSET  ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\testDB.xls;HDR=YES', 'select * from [Sheet1

select *中选择* br/>


') AS DB;




我个人更喜欢第二种方法.虽然看起来没有什么是完成它的最佳方法.

BR//
Harsha Narayana




I personally prefer the second method. Though it looks little complecated its the best way of doing it.

BR//
Harsha Narayana


这篇关于如何将Excel文件转换为SQL Server2005中的数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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