title: SQL Server "The wait operation timed out" when inserting records on remote server, but not locally
body: <p>There is a weird problem with a deployed Windows application that uses a remote connection string to SQL Server 2012.</p>
  
  <p>When inserting records, the SQL Server times out after a relatively short time saying "The wait operation timed out". I'm not able to debug the deployed application to find out why it is happening and where in the code it is happening.</p>
  
  <p>However, I don't get this error when using the <strong>same database</strong> on the development machine, with a <strong>local connection</strong>. </p>
  
  <p>Generally the code used is:</p>
  
  <pre><code>void MapData( SqlTransaction transaction, Dictionary&lt;int, IDataObject&gt; items )
  {
      foreach ( var i in items )
      {
          transaction.Save( "CHECKPOINT" );
  
          try
          {
              ImportItem( transaction, i );
          }
          catch ( Exception e )
          {
              transaction.Rollback( "CHECKPOINT" );
          }
      }
  
      ReportStatus();
  }   
  </code></pre>
  
  <p><strong>While this code has been working, I am uncertain about remote connections. We only have this one single case where it does NOT work.</strong></p>
  
  <p>What can it be?
  Is there a more solid or performant approach than using Save() and Rollback() in a loop?
  I don't want to use <strong>TransactionScope</strong> to spawn new "child" transactions.</p>
  
  <p>Thanks!</p>