views:

1720

answers:

3

What is the maximum number of connections to SQL Server 2005 for one user? I'm having a problem with C# code trying to make multiple connection to the database in different threads. After about five threads the connections in other threads start timing out. If i knew the exact number of connection for one user, even if it was one, would help with knowing how many threads I can have loading at one time.

+3  A: 

5 connections and you start to timeout? That smells like connections not being closed and/or concurrency issues (locks/deadlocks). I have services that spawn threads and generate upwards of 100 connections without any problems.

Otávio Décio
A: 

More so than the number of connections allowed per user, it may do you better to make sure you are effectively closing your connections as soon as you are done with them to make sure that the connection pool does not get used up too quickly.

TheTXI
+3  A: 

A long shot, 5 connections sounds like you might have licensing issues. Is the SQL instance you're using limited to the number of concurrent connections? (This is not something I've ever had to deal with. I know there are CAL licensing plans, and that there may be limits if you are using SQL Server Express edition.)

Philip Kelley