views:

58

answers:

2

I have a need to make a remote connection through a DSL line (getting about 16k/s) to a SQL Express 2005 instance much faster.

I think I can do it by having a SQL Express 2005 instance on the client's local machine and have it be a cached version of the data on the server.

I'm planning to allow changes to the remote server only and then require the user pull down updates from it occasionally. It's not ideal, but it'll work.

So, does SQL Express support me querying across the network something like:

INSERT INTO local.dbo.users (id, username, email, timestamp_modified)
    SELECT remote.dbo.users(id, username, email, timestamp_modified) 
        WHERE remote.dbo.users.timestamp_modified > LAST MODIFIED
+1  A: 

Why write something that has already been built and is available to you with the product you already have installed?

You should look into Log Shipping over your DSL line. It is a very reliable SQL Server product and has been tested extensively.

http://msdn.microsoft.com/en-us/library/ms187103.aspx

Although the express edition does not have SQL Server Agent, there are workarounds that you can use:

http://blog.willbeattie.net/2009/07/log-shipping-in-sql-server-express-2008.html

Raj More
Log shipping on demand doesn't seem to be possible.
Allain Lalonde
+2  A: 

For one you can use real Replication. You should also look into Service Broker. Both allow you to push the data from remote to a SQL Express instance. Service Broker performs and scales much better, is proven to work over slow DSL connections, but has a steep learning curve. Replicaiton is easy to set up but you'll have to live with it's limitations.

Using linked servers like you plan is not going to work. Is unreliable, slow, and doing updates over a linked server requires you to set up distributed transaction.

Remus Rusanu
How does replication work when one of the replicas is off most of the time (it's a laptop)? And can it be replicated on demand at the press of a button?
Allain Lalonde
Neither work very well for Ocasinally Connected Systems, specially ones that frequently change ip/names (laptop have different ip and fully qualified names on net depending where they connect from). One alternative is to use Snapshot replication over a VPN (rather cumbersome, and you need a way to initiate the replication agent when the laptop connects). Another alternative is the Sync Framework: http://msdn.microsoft.com/en-us/sync/bb887608.aspx which is designed specifically for laptops and mobile devices.
Remus Rusanu