all groups > sql server replication > november 2005 >
You're in the

sql server replication

group:

Synchronizing workstation and laptop


Synchronizing workstation and laptop Andreas Håkansson
11/11/2005 12:00:00 AM
sql server replication:
Hi!

I have a Windows 2003 SP1 machine (workstation) running with SQL Server 2000
and I also have a Windows XP Pro SP2 machine (laptop) running with
MSDE2000a. Both machines has Client Tools installed.

I do most of my development (programming) on my workstation but from time to
time I need to bring along my laptop and get some work done (not an uncommon
task). What I need to be able to do is synchronize my work between the two
machines. The source code is no problem, I just run a source control
application (check in/out), but I'm not sure how to solve synchronizing the
databases between the two machines.

Does anyone know of any smart (end preferbly easy to setup and administrate)
ways of synchronizing changes to the database design and contents between
the two? I was thinking of perhaps using replication, i.e each machine is a
publisher and also subscribes to eachothers publications. Would this be a
good solution? Are there any other options?



Thanks,

Andreas Håkansson

Re: Synchronizing workstation and laptop Paul Ibison
11/11/2005 12:00:00 AM
Andreas,
bidirectional transactional replication or merge would seem to be most
suitable, with queued updating subscribers (QUS)transactional also a
posibility. Out of the box merge or QUS are easier to set up.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Re: Synchronizing workstation and laptop José Araujo
11/11/2005 12:00:00 AM
That would work just fine for the data and the tables.

However, for the stored procedures and UDFs you need to come up with
something else (unless you're keeping that into your source control
repository).

BTW: using merge replication (don't know about transactional) you are not
going to be able to modify the tables schema in the subscriber (laptop).

José.

[quoted text, click to view]

Re: Synchronizing workstation and laptop Hilary Cotter
11/11/2005 9:54:59 PM
Merge replication can replication all objects including UDFs and procedures.
You can add and drop columns from existing merge replication topologies
using sp_repladdcolumn or sp_repldropcolumn.

[quoted text, click to view]

Re: Synchronizing workstation and laptop Hilary Cotter
11/12/2005 6:34:40 AM
There is no incremental publish option. It probably would be best to drop
the publication and recreate it each time, or script it out and only add the
new objects to the script.

[quoted text, click to view]

Re: Synchronizing workstation and laptop Andreas_Håkansson
11/12/2005 10:30:09 AM
[quoted text, click to view]

Thank you to all who have replied. This is a first to me so I'am taking
baby steps forward :) One thing I need to understand - If I setup a
merge replication does it define exactly what to merge (which tables,
udfs, procedures etc.) and I can't just say "what ever's new/changed in
the entire database should be included" ?

Since it's in the development phase I will add and tweak existing
tables, procedures etc. So having keep track of all the changes myself
and add them to the merge replication "set" would be a tedious task and
actually not remove much of the manual work I'd have to do without the
replication ?

Thanks,


Re: Synchronizing workstation and laptop José Araujo
11/14/2005 12:07:55 PM
Even though merge replication can replicate all dbobjects I think your
sysdepends table must be correct.

In other words, if you constatly recreate UDFs, StoredProcs, views (and he
probably does, since he is a developer) the sysdepends table information
gets "corrupted" - ie: it doesn't really have the dependencies (unless you
are REALLY careful of using alters all the time, and even doing that, there
are moments when you need to drop).

My experience is that the script that is included in the replication uses
that information to sort the different objects inside. Since that
information is wrong the script doesn't run in the subscriber (only for
StoredProc because you can create them in any order).

Hilary: I think we have discussed this before in other posts you have had
the courtesy to reply to me. I thought we agreed the sysdepends information
MUST be correct for that work. Did I get it wrong? (I actually developed my
own little utility to synchronize dbobjects because of that).

BTW: you can certainly add/drop fields in a merge replication but you need
to do it in the publisher (so when he is working on his laptop he won't be
able to modify the database schema).

Regards, José.

[quoted text, click to view]

Re: Synchronizing workstation and laptop José Araujo
11/14/2005 12:09:19 PM
Don't see an easy answer - unless you're the only developer in the project
(when you switch you can generate scripts for dbobjects and copy them to the
new database, and do the same when you switch back).

José.

[quoted text, click to view]

AddThis Social Bookmark Button