Afshar
Afshar

Reputation: 11483

Is it possible to MS SQL Replication by C# code? If yes, how?

I need to replication/sync data between a central database and a few local databases. All databases are MS SQL 2012. I have not access to central database via Management Stdio. It is on a shared host and I'm no sure if accessing replication services on it is possible at all.

It would be very helpful if there were a library or something similar to replicate/sync data between database via C#.

Is there any solution?

Thanks in Advance

Upvotes: 3

Views: 3770

Answers (1)

Brandon Williams
Brandon Williams

Reputation: 3755

This can be done via Replication Management Objects (RMO).

RMO allows programmatic control of Replication via the Microsoft.SqlServer.Replication namespace.

Have a look at Replication Management Object Concepts to get started.

Keep in mind that RMO is deprecated and may be removed in a future release of SQL Server. I've created Microsoft Connect item to request that Microsoft reconsider the deprecation of the RMO API. If you feel that it is important, please up-vote it.

Upvotes: 4

Related Questions