title: Disabling SQL Server's caching through .NET code
body: <p>I am currently calling up several stored procedures in some .NET code, <code>SqlConnection</code>. I'd like to disable the caching done by SQL Server, so that I can measure performance periodically (I'm gonna be comparing it to another server that likely won't have any cached data either). Is this possible to do without modifying the sprocs?</p>
  
  <p>This is the code that I am currently using:</p>
  
  <pre><code>using (SqlConnection connection = new SqlConnection(/* connection string goes here */)) {
  
      SqlCommand command = new SqlCommand(procName, connection);
      command.Parameters.AddRange(parameters);
      command.CommandType = System.Data.CommandType.StoredProcedure;
      connection.Open();
  
      SqlDataReader r = command.ExecuteReader();
      // todo: read data here
      r.Close();
      connection.Close();
  }
  </code></pre>