在SQL Server 2005中导入Excell工作表 [英] Import Excell sheet in SQL Server 2005
本文介绍了在SQL Server 2005中导入Excell工作表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi,
Is it possible to bulk insert data from an Excell sheet to a table through command?
推荐答案
最简单的方法是使用SSIS(SQL Server集成服务).否则,有两种方法可以从excel导入数据.
1:代码中的好方法
The easiest way is to use SSIS (SQL Server Intergration Services). Otherwise there are a couple of ways to import data from excel.
1: Nice approach from code
SQL SERVER – Import CSV File Into SQL Server Using Bulk Insert – Load Comma Delimited File Into SQL Server
[^]
2: Create a linked server in SQL Server, then reference the sheet by name
是的,可以.使用OpenRowSet函数:
Yes, it is possible. Use the OpenRowSet function:
select * from OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\myfile.xls', 'select * from [Sheet1
')
这篇关于在SQL Server 2005中导入Excell工作表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文