<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "如何將Excel資料匯入SQL Server 2005 Express"]]></title>
		<link>https://forum.andowson.com/posts/list/12.page</link>
		<description><![CDATA[Latest messages posted in the topic "如何將Excel資料匯入SQL Server 2005 Express"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>如何將Excel資料匯入SQL Server 2005 Express</title>
				<description><![CDATA[ SQL Server 2005 Express的SQL Server Management Studio Express沒有提供匯入/匯出精靈，只有在花錢買的版本才有提供，若要從Excel匯入資料只能從SQL查詢視窗使用SQL指令匯入，但要使用SQL指令匯入需要先開啟OPENROWSET才能執行匯入功能。 
<br>
依序操作如下： 
<br>
Microsoft SQL Server 2005 &gt; 組態工具 &gt; SQL Server 2005 介面組態 &gt; 功能的介面區組態 &gt; 勾選「啟用OPENROWSET和OPENDATASOURCE支援」 
<br>
[img]http://sites.google.com/site/andowson/_/rsrc/1222264646234/Home/sql2005_openrowset.jpg[/img] 
<br>
將要匯入的Excel檔就定位，例如放在D:\testdata\zipcode.xls，檢查一下，第一行是欄位名稱，第二行起是資料的部分，然後工作表名稱可以維持原本的Sheet1或是自己重新命名（記得下面的Sheet1$要配合修改） 
<br>
<br>
接著就可以執行 
<br>
[code]SELECT * INTO zone FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 
<br>
'Excel 8.0;Database=D:\testdata\zipcode.xls', [Sheet1$])[/code] 
<br>
<br>
http://sunrise-msn.spaces.live.com/blog/cns!487A9984929026B7!392.entry 
<br>
http://support.microsoft.com/kb/321686 
<br>
http://forums.microsoft.com/Technet-CHT/ShowPost.aspx?PostID=3697780&amp;SiteID=23]]></description>
				<guid isPermaLink="true">https://forum.andowson.com/posts/preList/268/447.page</guid>
				<link>https://forum.andowson.com/posts/preList/268/447.page</link>
				<pubDate><![CDATA[Thu, 28 Aug 2008 18:57:30]]> GMT</pubDate>
				<author><![CDATA[ andowson]]></author>
			</item>
	</channel>
</rss>