iT邦幫忙

第 11 屆 iThome 鐵人賽

DAY 11
1
Modern Web

淺談資料庫&ASP.net&C# 入門系列 第 11

[iT鐵人賽Day11]SQL Server 匯入Excel資料表

從SQL Server 匯入Excel資料成為資料庫內的資料表

現在有一份xls的檔案(記得副檔名要xls不能xlsx),要將它匯入成為資料表。
https://ithelp.ithome.com.tw/upload/images/20190911/20119925okPjpdL5Mh.png

首先對著資料庫右鍵選工作然後匯入資料
https://ithelp.ithome.com.tw/upload/images/20190911/20119925oWzUAi5orq.png

會到了選擇資料來源的畫面,然後資料來源就選Excel,並將檔案路徑選到我們的資料,就可以按next。(記得副檔名要xls不能xlsx)

https://ithelp.ithome.com.tw/upload/images/20190911/20119925AgzmzzP5wf.png

之後會到選擇目的地的畫面,目的地選SQL Server Native Client 11.0,然後按next

https://ithelp.ithome.com.tw/upload/images/20190911/201199258cNncvGHPT.png

一樣next

https://ithelp.ithome.com.tw/upload/images/20190911/20119925CaBGgNXAbX.png

接下來在目的地下的欄位可以更改資料表的名稱,這邊先取成"TEST123"
https://ithelp.ithome.com.tw/upload/images/20190911/201199250oCYJx30QK.png

接下來就瘋狂的next或finish,跑完後close

https://ithelp.ithome.com.tw/upload/images/20190911/201199256qKGWRg80Y.png

接下來去資料表上重新整理,並點開資料表的資料夾,會發現剛剛匯入的資料表出現了。
選編輯前200個資料列,後就會發現有資料了><

https://ithelp.ithome.com.tw/upload/images/20190911/20119925znhiqiVjST.png

https://ithelp.ithome.com.tw/upload/images/20190911/20119925kIK10bcTkP.png

這樣就匯入資料表成功了XD


上一篇
[iT鐵人賽Day10]SQL語法小精靈
下一篇
[iT鐵人賽Day12]ASP.NET與資料庫的聯繫
系列文
淺談資料庫&ASP.net&C# 入門36
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 則留言

1
YoChen
iT邦研究生 1 級 ‧ 2019-09-12 18:10:26

記得副檔名要xls不能xlsx

是不是寫反了~XDDD

捲毛蔡 iT邦新手 4 級 ‧ 2019-09-16 09:50:35 檢舉

啊!是當時截圖時按成xlsx了,所以截圖成xlsx,副檔名是要xls沒有錯><感謝提醒

我要留言

立即登入留言