Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
gobotsoup
Starting Member
6 Posts |
Posted - 2007-04-11 : 14:02:56
|
hi I was just writing for some general advice. If I am to do many updates on a table is it okay to keep updating with many insert statements inside of a loop closing the connection each time? Here is some pseudo code to give you an idea:cnn.open();cmd = "insert into Cats values (red,4994,homer)";for(int i=0; i<10000; i++){ cmd.executenonquery(); cnn.close();} |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-04-11 : 14:15:38
|
I would keep the connection open until you are done with the loop.Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2007-04-14 : 16:44:27
|
Why not run it in a SP your script could timeout. |
 |
|
|
|
|