title: Will setting the connection timeout kill the query on the server side as well?
body: <p>I have some code querying a back-end SQL Server:</p>
  
  <pre class="lang-c# prettyprint-override"><code>using (SqlConnection con = new SqlConnection(connString))
  {
      SqlDataReader dr;
      SqlCommand cmd;
      cmd = new SqlCommand("PROC1", con);
      cmd.CommandType = CommandType.StoredProcedure;
      cmd.CommandTimeout = 300;
  
      try 
      {
         con.Open();
         dr = cmd.ExecuteReader();
  
         while(dr.Read()) 
         {
            // ...
         }
      }
      catch (SqlException e) 
      {
         // Some logging
      }
      catch (Exception e)
      {
         // Some logging
      }
  }
  </code></pre>
  
  <p>Once the timeout happens, I am expecting the connection will be closed and the outstanding query will be killed. I am facing an issue where the <code>tempdb</code> size has been constant or increasing. Because there are many other processes accessing the same server, I want to ensure that I am not causing this from my end. </p>
  
  <p>When a query timeout occurs, can I expect that SQL Server cleans up and properly kills outstanding queries on the server-side or should I be doing anything more from my side?</p>