In this scenario there are two database servers: one is in our LAN (Server A) and one on our remote location (Server B).
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.
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. :)
I have SET NO COUNT turned on. I've read that this could make remote queries faster.
What could be causing this slow transfer?
EDIT:
The SQL should really be the cause. It breaks down like this:
- Select data from all kinds of databases and insert it into a DB on Server A
- Delete from Server B DB Where ProjectID = x
- Insert into Server B DB - Select * from Server A DB Where ProjectID = x
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.