Is there any way we can we find the query for the spid which is in sleep status? How can we find that why it is in sleep or suspend status? Please let me know.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A sleeping SPID is simply a client connection with no active query to the SQL Server. There will be no query associated with the SPID in this state.
You may see these as a result of applications using connection pooling where it would otherwise be expensive to keep opening and closing connections. The connection pool retains open connections that await further queries or batches. Without knowing your setup it is possible the sleeping SPIDs are associated with open connections in a pool.
Alternatively your client/application may not be closing connections after it’s work is done. If you are getting blocking issues, a sleeping SPID can lock resources if it has opened a transaction and not committed or rolled back.
If the sleeping connections are not causing any adverse problems (i.e. hundreds overloading the server) then it is not an issue and best left alone.