如何将数据从 Excel 工作表插入到 SQL Server 2005 [英] How to insert data from Excel sheet to SQL Server 2005

查看:37
本文介绍了如何将数据从 Excel 工作表插入到 SQL Server 2005的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个 Excel 工作表,我需要将该工作表中的数据插入到 SQL Server 2005 中.

I have an Excel sheet now I need to insert data from that sheet into SQL Server 2005.

我需要创建一个临时表并将数据插入到该表中.数据库名称为 Employee

I need to create a temp table and insert data into that table. The database name is Employee

你能提供我实现它的语法吗.

Can you pls provide me the syntax for achieving it.

推荐答案

简单搜索:http://support.microsoft.com/kb/321686

可能是最简单的

SELECT *
INTO #tmptable
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', [SheetName$])

这篇关于如何将数据从 Excel 工作表插入到 SQL Server 2005的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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