Showing posts with label merge. Show all posts
Showing posts with label merge. Show all posts

Friday, March 23, 2012

How to Setup Merge replication with sql express

I have a Windows Mobile aplication that uses merge replication to synchronize between sql compact and full sql Enterprise edition and It works great. Instantiating the SqlCeReplication object setting it's properties and calling Synchronize on it is pretty simple assuming everything is setup properly at the publisher.

For the life of me I can't figure out how to do this on the desktop (Programatically setup a subscription and create a database using objects in the System.Replication Namespace and hopefully call Synchronize on it).

Someone please point me in the right direction.

Thanks,


Patrick

See topic "Programming with Replication Management Objects", http://msdn2.microsoft.com/en-us/library/ms146869(SQL.90).aspx.

|||

Look at the MergeSynchronizationAgent class.

Here is some sample code in C#:

Code Snippet

_mergeAgent = newMergeSynchronizationAgent();

_mergeAgent.Publication = _publication;

_mergeAgent.Publisher = _publisher;

_mergeAgent.PublisherDatabase = _publisherDB;

_mergeAgent.PublisherSecurityMode = SecurityMode.Integrated;

_mergeAgent.Distributor = _distributor;

_mergeAgent.DistributorLogin = _distributorLogin;

_mergeAgent.DistributorPassword = _distributorPassword;

_mergeAgent.DistributorSecurityMode = SecurityMode.Standard;

_mergeAgent.Subscriber = _subscriber;

_mergeAgent.SubscriberDatabase = _subscriberDB;

_mergeAgent.SubscriberLogin = _subscriberLogin;

_mergeAgent.SubscriberPassword = _subscriberPassword;

_mergeAgent.SubscriberSecurityMode = SecurityMode.Standard;

_mergeAgent.SubscriptionType = SubscriptionOption.Pull;

_mergeAgent.LoginTimeout = _LoginTimeOut;

_mergeAgent.QueryTimeout = _QueryTimeOut;

_mergeAgent.Synchronize();

Hope this helps!

Wednesday, March 21, 2012

How to setup front-end IIS and back-end SQL server?

Hi,

I need some help in setting up a front end IIS box and back end SQL 2005 box. I will be using merge replication.

Front end server will be a 32 bit.

How exactly do you do this? Anyone have any links to articles that walks through the setup?

Thanks,

p

Hi Pintu, see this link:

http://www.databasejournal.com/features/mssql/article.php/1438231

Wednesday, March 7, 2012

How to set Merge Repl properties for multiple servers?

Hello...
Currently we have merge replication set up between SQL 2000 and mobile
devices running SQL CE 2.0...and some with SQL Mobile.
As part of the logic on the device, we have to set some properties for the
SqlCeReplication object. Some of these we make dynamic, like the
publication, login, etc.
However, we currently hard code the Publisher and InternetURL values to our
existing server like:
repl.Publisher = "MyMachineName"
repl.InternetURL =
"http://MyMachineName.domain.com/SqlRepl/sqlcesa20.dll"
My question or problem is this...what happens in the case of a failover? We
have a backup/redundant/mirrored server at a different geographic
location...obviously it has a different server name. For the devices in the
field, how do people handle this type of situation where the server failover
will occur automatically. Or, if we decide to move to a server farm...where
we have multiple Sql Servers...how can we make our mobile application
agnostic to the Publisher?
Thanks for any help or advice.
- will
The best way to do this is to put your publisher on a cluster.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"dw" <dw@.discussions.microsoft.com> wrote in message
news:D241EC93-AFFF-4024-B342-99AF1C4E82D4@.microsoft.com...
> Hello...
> Currently we have merge replication set up between SQL 2000 and mobile
> devices running SQL CE 2.0...and some with SQL Mobile.
> As part of the logic on the device, we have to set some properties for the
> SqlCeReplication object. Some of these we make dynamic, like the
> publication, login, etc.
> However, we currently hard code the Publisher and InternetURL values to
our
> existing server like:
> repl.Publisher = "MyMachineName"
> repl.InternetURL =
> "http://MyMachineName.domain.com/SqlRepl/sqlcesa20.dll"
> My question or problem is this...what happens in the case of a failover?
We
> have a backup/redundant/mirrored server at a different geographic
> location...obviously it has a different server name. For the devices in
the
> field, how do people handle this type of situation where the server
failover
> will occur automatically. Or, if we decide to move to a server
farm...where
> we have multiple Sql Servers...how can we make our mobile application
> agnostic to the Publisher?
> Thanks for any help or advice.
> - will
|||Would that mean the Publisher and Distributor would be on different machines?
"Hilary Cotter" wrote:

> The best way to do this is to put your publisher on a cluster.
> --
>
|||dw wrote:
> Hello...
> Currently we have merge replication set up between SQL 2000 and mobile
> devices running SQL CE 2.0...and some with SQL Mobile.
> As part of the logic on the device, we have to set some properties for the
> SqlCeReplication object. Some of these we make dynamic, like the
> publication, login, etc.
> However, we currently hard code the Publisher and InternetURL values to our
> existing server like:
> repl.Publisher = "MyMachineName"
> repl.InternetURL =
> "http://MyMachineName.domain.com/SqlRepl/sqlcesa20.dll"
> My question or problem is this...what happens in the case of a failover? We
> have a backup/redundant/mirrored server at a different geographic
> location...obviously it has a different server name. For the devices in the
> field, how do people handle this type of situation where the server failover
> will occur automatically. Or, if we decide to move to a server farm...where
> we have multiple Sql Servers...how can we make our mobile application
> agnostic to the Publisher?
> Thanks for any help or advice.
> - will
Try using a DNS alias name and have your subscribers connect to that. When you change the server,
also change DNS to point to the new machine. Will be transparent to the subscribers. Make sure
that the server will respond to the alias name.
We use aliases at my company. Recently, the motherboard on our production server died. All the
data files are on an external disk array. We have an identical server as backup. We moved the C:
hard drive to the backup server and moved the cable from the disk array. We changed DNS to point
the alias to the new server. Back up in 10 minutes.
This also works when upgrading to a bigger server.
|||No, they should be on the same machine.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"dw" <dw@.discussions.microsoft.com> wrote in message
news:09D18E34-DC6F-4EAE-82F4-07645EE1578E@.microsoft.com...
> Would that mean the Publisher and Distributor would be on different
machines?[vbcol=seagreen]
> "Hilary Cotter" wrote: