1

I am using transaction replication with push subscription. I am developing a UI for replication using RMO in C#.NET between different instances of the same database within same machine holding similar schema and structure. I am using Single subscriber and multiple publisher topology. During creation of publication i want to set a few article properties such as Keep the existing object unchanged ,allow schema changes at subscriber to false a,copy foriegn key constarint and copy check constraints to true. How do i set the article properties using RMO in C# .NET. I am using Visual Studio 2008 SP1.I also want to know as how we can select all the objects including Tables,Views,Stored Procedures for publishing at one stretch. I could do it for one table but i want to select all the tables at one stretch. This is the code snippet i used for selecting single table for publishing.

TransArticle ta = new TransArticle();
ta.Name = "Article_1";

ta.PublicationName = "TransReplication_DB2";
ta.DatabaseName = "DB2";

ta.SourceObjectName = "person";
ta.SourceObjectOwner = "dbo";

ta.ConnectionContext = conn;
ta.Create();  
Pavan Kumar
  • 65
  • 1
  • 4
  • 13

1 Answers1

1

Use the TransArticle.PreCreationOption property to specify what action should be taken. Set this property to None if you dont want to recreate the schema when article is created for the second publication.

yogesh
  • 11
  • 1