【发布时间】:2009-06-14 15:33:19
【问题描述】:
我有一个程序,我需要在其中针对 MS SQL 表运行多个插入语句(动态生成)。现在,我做(伪代码):
Loop
Generate Insert Statement String
SQLCommand.Text = Generated Insert Statement String
SQLCommand.Execute().
End Loop
Close Connection
简单地构造一大串插入,用分号分隔是否更好。并且只运行一条 SQLCommand.Execute() 语句?还是没有区别?
谢谢!
【问题讨论】:
标签: sql database sql-server-2005 database-connection