Solved

Can a SQL connection have more than one spid?

Posted on 2013-01-31
6
353 Views
Last Modified: 2013-10-09
Hi,

We are having some connection problems with SQL server 2008.
SQL gets an error and creates a mini dump when we run the program.
One curious question is can a connection only have one spid at a time?
Or can it have multiple and how does it relate to the connection pool.
The other thing is they have been changing the database status from multi user mode to single user and then it is changed back to multiple user.

Were thinking something is happening when it changes between single and multi user mode and the connections in the pool and the active connection.
0
Comment
Question by:remenard
  • 3
  • 2
6 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 38840426
"SQL gets an error and creates a mini dump when we run the program" - for that you need to open a case(call) to the vendor which in this case is Microsoft and send them the DUMP file(s) to be analyzed.

"The other thing is they have been changing the database status from multi user mode to single user and then it is changed back to multiple user.

Were thinking something is happening when it changes between single and multi user mode and the connections in the pool and the active connection. "

when "they" change the database in single user mode then...obviously only 1(ONE) user or ONE connection can be made so...you draw the conclusion. the rest must be terminated somhow and if "they" use the "rollback immediate" as well then yes...you can have lots of issues and should never be done against live DB's in my opinion.

Also a SQL SPID is tied to only ONE connection.
0
 
LVL 9

Expert Comment

by:MattSQL
ID: 38842369
Yes 1 connection = 1 SPID, connection pooling is when multiple application sessions/users are able to reuse existing connections...

What is the error that SQL is returning?
0
 

Author Comment

by:remenard
ID: 38855563
The error we are getting we trap is after it tried to set the database to multi user mode.

Setting Database to Multi User Mode.
Failed to connect to server .

The error does not seem to trap more information, sorry to say,
checked SQL server logs nothing and checked event logs nothing there either.
The application is C# using Dot Net SQL libraries and our own.

Wish I had more information but all I have at the moment.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:remenard
ID: 38859812
The other two things I found out is that they have added the service broker to the database.
The database could also have replication running as well in some cases.
I would guess this would make the connections issue more complex.

Would it be better to go through and kill each spid by it self and then change from multi user to single user?  
Not sure that would help clear out the connetions better thatn via the database mode change.

Thanks.
0
 
LVL 9

Expert Comment

by:MattSQL
ID: 39316169
I'm sorry - this slipped off my radar. Do you still need assistance?
0
 

Author Comment

by:remenard
ID: 39560282
Sorry, we been swamped, looks like it was connection that was created in an application and then passed to another module when it should not of been.
Thanks for you help.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now