Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 342
Afshar Mohebi Avatar asked Jun 06 '26 18:06

Afshar Mohebi


1 Answers

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.

like image 183
Brandon Williams Avatar answered Jun 09 '26 07:06

Brandon Williams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!