Monday, February 20, 2012

Is there an easy way to synchronize two tables in different databaes using a SQL

news.valornet.com wrote:
> Hi,
> I am going to be writing an application where a server has MS SQL 2K on it
> with some tables that I will need locally on some notebooks when they aren
't
> connected to the server. I need to also create other tables for my
> application so I figured I would create tables to match the ones I need fr
om
> the server in the same local database on these notebooks. I could probabl
y
> delete the local table and then use a select into from the server to refil
l
> it again, but is there a better way? Like some sort of synchronization
> where you specify both tables and only the changes from the source table a
re
> applied to the destination table?
> Thanks,
> Alan
> [url]http://www.evelopment.com[/url]
> Home of Partition Boot Manager and Large Drive Tools utilities!
Are the laptops going to have SQL installed on them? If so,
transactional replication should do the trick. Publish the master
tables (from the server), and have each laptop subscribe to those
publications.Hi Tracy,

> Are the laptops going to have SQL installed on them? If so,
> transactional replication should do the trick. Publish the master
> tables (from the server), and have each laptop subscribe to those
> publications.
Thanks for responding.
What I am trying to do is pull a certain few tables from the server and
store them locally. I would prefer to do this with SQL code and a button in
my application called "Synchronize". The customer clicks synchronize and
then it executes some SQL to bring the local tables in sync with the network
ones. The tables aren't so large that they can't be completely emptied and
recopied from the network each time. I am writing in C++ using a component
called SDAC (www.crlab.com) to issue SQL commands. I can create two
connection components but each one can only see its connection to the server
it is configured for. I've taken a look ad sp_addlinkedserver, and wonder
if this is the direction I should go. Any ideas?
Thanks,
Alan
[url]http://www.evelopment.com[/url]
Home of Partition Boot Manager and Large Drive Tools utilities!

No comments:

Post a Comment