Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6570683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:47:10+00:00 2026-05-25T14:47:10+00:00

I just tried to make a simple schema change to a table in a

  • 0

I just tried to make a simple schema change to a table in a SQL Server database (by using the Design tool in SMSS). Whenever I tried to save the change, it kept timing out. I wondered whether this was due to existing connnections which were ‘locking’ the table.

I decided to kill connections as an experiment. I queried master..sysprocesses to get the current spids for that database, and killed them one by one until I was able to save my schema change. (Not very scientific, but I’m far from an expert with SQL Server). Sure enough, when I had killed all the spids (bar the one which was me using SMSS), I was able to save the schema change.

I would like to ask about the relationship between ADO.NET SqlConnections and spids. For example, if the client app calls Open() on a SqlConnection object, should I see another spid in master..sysprocesses? What about if I call Close() on that SqlConnection? Should the spid disappear?

I’m sure it’s not quite that simple, since I understand there is a notion of connection pooling, but can someone shed any light on how this relationship works?

Thank you

David

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:47:10+00:00Added an answer on May 25, 2026 at 2:47 pm

    If pooling=false in the connection string

    SqlConnection.Open() and Close() will exactly correlate to spids being created and destroyed. This results in very slow performance 🙂

    If pooling=true in the connection string

    Calling SqlConnection.Open() will either use an existing physical connection from the pool, or create a new one if none are available in the pool.

    Creating a new physical connection will create a new spid, which will show up as a new row in sys.sysprocesses and sys.dm_exec_connections.

    Reusing an existing pooled physical connection will just reuse an existing spid so you SqlConnection.Open() will not make any visible change in those tables on the server side. However it can be detected by using SQL Profiler or XEvent by looking for sp_reset_connection, which is a stored procedure called by SqlClient that tells the server to clear the connection state (e.g. make sure there is no transaction, etc).

    SqlConnection.Close() will usually return the physical connection to the pool, so it will not disappear from the server. Physical connections are actually closed in various ways under the hood, such as by being killed by the server such as kill @spid and SqlConnection.ClearAllPools().

    Hope that is enough detail, is there anything else you’d like to know?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started out in Vala, and I tried to make a simple
I'm new for iOS develop. I tried to make a very simple app just
I have just tried using the NSArchiver but for some reason I am getting
Just tried writing a simple validates_presence_of in my model, and when the errors try
I just installed MySQL 5 on my server and imported a database from another
I just got started today developing for Android. I tried to make an application
I tried to make a simple demo program that use zlib to compress &
I just tried to write a simple C program on OSX Lion #include <stdio.h>
I had make a simple app into a facebook page and I just want
So I'm trying to just add a simple ad to my app using admob.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.