[問題] insert into...select如何做批次commit?

看板C_Sharp (C#)作者 (BO...om!!)時間14年前 (2011/09/28 23:44), 編輯推噓0(004)
留言4則, 3人參與, 最新討論串1/1
大家好 最近需做資料庫整檔 要將 tableA資料 搬至tableA_H (兩資料表欄位不同 tableA_H有加新欄位) 用OleDbCommand(oracle資料庫) 下一個SQL: "insert into tableA_H(filed1, filed2...) select field1, field2... from tableA where 條件" 資料非常大量 幾十萬筆跑不掉 如果利用command.ExecuteNonQuery() 中間程式當掉的機會很大 要怎麼改變command的sql 做一個迴圈 讓程式可以一萬筆資料就commit一次?? C#該怎麼做才能批次commit呢? 也在網路上搜尋過了...實在沒頭緒 有無好方法請開導一下 感激不盡!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.124.211.32

09/29 00:16, , 1F
BulkCopy ?
09/29 00:16, 1F

09/29 07:54, , 2F
oracle資料庫也可以用?
09/29 07:54, 2F

09/29 09:10, , 3F
google oracle bulk insert
09/29 09:10, 3F

09/29 13:00, , 4F
thanks 先試試看
09/29 13:00, 4F
文章代碼(AID): #1EWq3L1H (C_Sharp)
文章代碼(AID): #1EWq3L1H (C_Sharp)