title: Increase performance on DELETE/INSERT on remote server
body: <p>In this scenario there are two database servers: one is in our LAN (Server A) and one on our remote location (Server B).</p>
  
  <p>We want to transfer the data of our projects from Server A to Server B. To do this we first remove the existing data on Server B for a certain ProjectID and after that simply insert the data from Server A to Server B. All data is prepared on Server A.</p>
  
  <p>The actual amount of data transfered is approximatically 2.5MB. With our 20MBit connection this should be done in a flash. However with SQL it takes 30-40 seconds. Actually if you would take the same amount of data and transfer it with FTP, it takes 4 sec. :)</p>
  
  <p>I have SET NO COUNT turned on. I've read that this could make remote queries faster.<br>
  What could be causing this slow transfer?</p>
  
  <p>EDIT:<br>
  The SQL should really be the cause. It breaks down like this:<br>
  - Select data from all kinds of databases and insert it into a DB on Server A<br>
  - Delete from Server B DB Where ProjectID = x<br>
  - Insert into Server B DB - Select * from Server A DB Where ProjectID = x</p>
  
  <p>The last two steps take about 40 seconds. And as you can see all I do is remove the old records and insert the new ones. No joins or difficult t-sql syntax.</p>