我有一個程序,我需要對MS SQL表運行多個插入語句(動態生成)。現在,我做的(僞代碼):執行多個插入語句,最好的方法是什麼?
Loop
Generate Insert Statement String
SQLCommand.Text = Generated Insert Statement String
SQLCommand.Execute().
End Loop
Close Connection
是更好的性能,明智的做法是簡單地構建插入的一個大的字符串,用分號隔開。並只運行一個SQLCommand.Execute()語句?或者它沒有影響?
謝謝!
它確實;這是一個名爲bcp的程序。 – Jacob 2009-06-14 15:43:47