我有一个程序,我需要在其中针对 MS SQL 表运行多个插入语句(动态生成)。现在,我做(伪代码):
Loop
Generate Insert Statement String
SQLCommand.Text = Generated Insert Statement String
SQLCommand.Execute().
End Loop
Close Connection
简单地构造一大串插入,用分号分隔是否更好。并且只运行一条 SQLCommand.Execute() 语句?还是没有区别?
谢谢!