我有一个程序,我需要对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