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

Wednesday, March 28, 2012

RMO: getting the agentid for AssignToAgent

Hello,

I'd like to assign a custom profile to a merge replication agent. The AssignToAgent() method takes the distribution db name and the agentID as an integer. Which method is used to get at this agentID? All I can find is the job ID in the subscription class.

Thanks!

Scott

You could try something like this

string distServerName = "mydistributionserver";
ServerConnection distServerConn = new ServerConnection(distServerName);
distServerConn.Connect();
AgentProfile logReaderAgentProfile = new AgentProfile("MyLogReader", distServerConn);
logReaderAgentProfile.Description = "My New LogReader Profile";
logReaderAgentProfile.AgentType = AgentType.LogReaderAgents; // change this to MergeAgents
logReaderAgentProfile.Create();
logReaderAgentProfile.CachePropertyChanges = true;
logReaderAgentProfile.MakeDefault();

// Set parameter values
logReaderAgentProfile.ChangeParameter("historyverboselevel", "1");
logReaderAgentProfile.ChangeParameter("logintimeout", "15");
logReaderAgentProfile.ChangeParameter("pollinginterval", "10");
logReaderAgentProfile.ChangeParameter("querytimeout", "1200");
logReaderAgentProfile.ChangeParameter("readbatchsize", "250");
logReaderAgentProfile.CommitPropertyChanges();

Hope this helps

Cheers

sql

RMO Error with Web replication

I am testing Web merge replication between SQL Server and SQL Server Express.

If I use Windows Synchronization (mobsync.exe) everything goes well.

If have created a simple program in VB.net 2005, using sample code from this forum and MSDN and I always get this error: "The Merge Agent process could not write Web synchronization metadata in the message header. Verify that there is sufficient disk space in the Web synchronization directory. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147199467)". All parameters are identical to the one used with mobsync.exe

Does anyone know what this error mean and how can I avoid it ?

Thanks in advance,
Riccardo Sabadini

1. Do you mind posting your parameters used in mobsync.exe here? (Please take care of the actual password).

2. Can you check if you have the appropriate port opened on distributor/publisher or subscriber machines?

3. I assume when you run VB.net application, it is on the subscriber machine, rgiht? Do you specify the InternetLogin and Internet password so the app is able to connect to the web sync virtual directory?

Thanks.

This posting is provided AS IS with no warranties, and confers no rights.

RMO Equivalent for Merge Replication T-SQL Procedures

We want to have some information about RMO (Replication Management Objects in SQL Server 2005) equivalent for the following Merge Replication T-SQL procedures.

sp_changemergearticle
sp_helpmergearticleconflicts
sp_helpmergeconflictrows
sp_helpmergedeleteconflictrows
sp_deletemergeconflictrow

Since I was not aware of these RMO properties, here is a response from someone who has that knowledge.

Changing properties in MergeArticle object should be calling sp_changemergearticle.

Replicationdatabase.EnumCOnflcitTables should be equivalent to sp_hlepmergecarticleConflicts.

I don’t think we have any RMO methods that are equivalent to the last 3 proc calls

|||Thanks Mahesh, for your information. We will check that, if you can find any equivalent implementation for other three methods or any work around in order to use the other three methods that would be great ful.

Thanks
VDeevi.|||Sure, I will let you know.
Meanwhile, cant you wrap the other calls as a sql statement and make the calls?Also, you could add your logic in that! wouldnt that work for you?|||Thanks for your information. We will try to build the components based on the sproc calls to these stored procedures using ADO.Net. Once again thanks for your help.

Thankssql

Monday, March 12, 2012

reverse merge repliction

hi

I have notice that i missed few columns in my merge repliction and i wonder is it possiblie to reverse a replicated database or copy to normal SQL database?

after that i would do a new Publication.

I need to have the data that is in the Database.

If this is SQL Server 2005, you can always use alter table and add the new columns to the table. They should automatically propagate to the subscriber.

If you wish you can drop the publication, add the columns and reset the publication too.

The data in the tables will be intact.

reverse merge repliction

hi

I have notice that i missed few columns in my merge repliction and i wonder is it possiblie to reverse a replicated database or copy to normal SQL database?

after that i would do a new Publication.

I need to have the data that is in the Database.

If this is SQL Server 2005, you can always use alter table and add the new columns to the table. They should automatically propagate to the subscriber.

If you wish you can drop the publication, add the columns and reset the publication too.

The data in the tables will be intact.