iT邦幫忙

0

EXCEL 怎麼匯不進 MS SQL

我搜尋網路 https://ithelp.ithome.com.tw/m/articles/10190390 , 但匯不進去
要匯的 EXCEL
https://ithelp.ithome.com.tw/upload/images/20181216/201043261z1Y3clC2d.png
匯到 CUSTOMER
https://ithelp.ithome.com.tw/upload/images/20181216/20104326LryA42jhNB.png
以下是匯的過程
https://ithelp.ithome.com.tw/upload/images/20181216/20104326tOwoZOBBLQ.png
https://ithelp.ithome.com.tw/upload/images/20181216/20104326u9HqlK4dJu.png
https://ithelp.ithome.com.tw/upload/images/20181216/20104326l2EKF4oV23.png
https://ithelp.ithome.com.tw/upload/images/20181216/201043264jNFR6ID8e.png
https://ithelp.ithome.com.tw/upload/images/20181216/20104326wbukdolhw0.png
https://ithelp.ithome.com.tw/upload/images/20181216/20104326xI3kjoVIa1.png
https://ithelp.ithome.com.tw/upload/images/20181216/20104326ACXHHUr6r5.png
https://ithelp.ithome.com.tw/upload/images/20181216/201043265oOrhlf0Cy.png
https://ithelp.ithome.com.tw/upload/images/20181216/20104326VRmP0fpVTw.png

最後怎麼還是沒進來

https://ithelp.ithome.com.tw/upload/images/20181216/2010432677QjB8nlTi.png

ant1017 iT邦新手 2 級 ‧ 2018-12-17 11:38:58 檢舉
人家明明就講得蠻詳細的,說明都不看清楚
"對應資料表.欄位"
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中
1
竹本立里
iT邦好手 1 級 ‧ 2018-12-17 09:12:36
最佳解答

因為 EXCEL 跟SQL 兩個欄位不一致

EXCEL 沒有ID 欄位

而且你的SQL內 ID 不允許NULL
https://ithelp.ithome.com.tw/upload/images/20181217/20102474CMa2TXHEr1.jpg

看更多先前的回應...收起先前的回應...
alex9453 iT邦新手 2 級 ‧ 2018-12-21 12:26:15 檢舉

我改成允許 NULL , 欄位也一樣 , 請問是哪裡有問題

https://ithelp.ithome.com.tw/upload/images/20181221/20104326e8ucSr01PC.png
https://ithelp.ithome.com.tw/upload/images/20181221/20104326RxbJDK83Ie.png
https://ithelp.ithome.com.tw/upload/images/20181221/20104326f92ZATKKBE.png
https://ithelp.ithome.com.tw/upload/images/20181221/20104326bhLq5R3I8H.png
https://ithelp.ithome.com.tw/upload/images/20181221/201043260FPDDJd1FL.png
https://ithelp.ithome.com.tw/upload/images/20181221/201043267eM2vf8Mz9.png
https://ithelp.ithome.com.tw/upload/images/20181221/20104326t6V4fZxUYO.png

alex9453 iT邦新手 2 級 ‧ 2018-12-21 12:31:18 檢舉

匯入過程只讓我選資料庫 , 我要選匯入設計好的資料表 day,有匯到資料庫 , 但沒匯到指定的資料表

alex9453 iT邦新手 2 級 ‧ 2018-12-21 12:31:51 檢舉

https://ithelp.ithome.com.tw/upload/images/20181221/20104326o5OCJrZTrZ.png

最簡單的方法
1.excel 加一個ID欄位 或是
2.SQL 取消ID欄位

1
rogeryao
iT邦大師 1 級 ‧ 2018-12-17 00:22:20

1.下圖 1 設定後,預覽資料是否正確
2.查看圖 2 問題是什麼 :
a:型態不一致(Excel Id:VarChar , SQL Id:bigint) ?
b:Excel Id 無值?

圖 1
https://ithelp.ithome.com.tw/upload/images/20181217/200850211y279c6hvF.png
圖 2
https://ithelp.ithome.com.tw/upload/images/20181217/200850212A9J5Igwhg.png

0
sonia
iT邦新手 2 級 ‧ 2018-12-17 09:21:22

好奇怪,匯入的來源為何不選excel檔呢?

1
Ryan
iT邦新手 4 級 ‧ 2018-12-17 15:44:41

ID欄位可以設定成自動遞增+1,應該就可以匯入了。

我要發表回答

立即登入回答