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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL server freezes when running multiple INSERTS

Author  Topic 

Chris H
Starting Member

4 Posts

Posted - 2008-12-10 : 14:02:43
I'm using SQL Server 2005 Express and connecting to it from a VB.Net 2.0 application.

My application is running simple INSERT commands into a table that only has 8 columns over TCP/IP. There are thousands (possibly tens of thousands) of similiar INSERT commands to be run but I'm finding the entire process freezes when I reach to about the 1520th INSERT command. No exception is thrown and my application just sits there waiting for the database to respond.

The SQL service is still running because I can still run queries against the databse from the Management Studio. My system seems to be fine as far as memory and processor power go since nothing is getting maxed out.

Has anyone else had this problem?

hanbingl
Aged Yak Warrior

652 Posts

Posted - 2008-12-10 : 14:16:34
Can you run a SP_WHO2 when it "freezes" and check for blocks?
Do you have multi-thread inserting at the same time?
Is your application responding?
Go to Top of Page

Chris H
Starting Member

4 Posts

Posted - 2008-12-11 : 12:32:53
It seems to be working much better after I added the following to my connection string to try and improve my app's efficiency.
MultipleActiveResultSets=True I'm still testing to see if it's just a momentary fix or not.

Because of a change to .Net 2.0 and SQL 2005, a connection cannot have more than one DataReader attached to it. So, I was closing and re-opening the database connection each time I ran a query. By adding MultipleActiveResultSets=True I can now open the connection one time and process my thousands of INSERT commands. It seems a side effect of this change was that now all of my INSERT commands are working correctly.

We'll see what happens.
Go to Top of Page
   

- Advertisement -