Search code examples
sql-serverreplicationtransactional-replication

Database Difference on publisher and subscriber


I currently have SQL Server Transactional replication running. Server A (Publisher & Distributor) to Server B (Subscriber). Everything is working great. I just need to know whether i can add a table to the subscriber only in that database? will it affect my replication? must the databases be the exact same in terms of schema etc?

I need to add a table that's not part of the publishers published articles on Server B(Subscriber).


Solution

  • I just need to know whether i can add a table to the subscriber only in that database?

    Yes, you can. It won't affect to the replication, but, for example, if you create table dbo.A on subscriber database first and later you'll create table with the same name and schema on publisher database you can lost data in table dbo.A on subscriber because by default new articles on the subscriber will be drop if exists within initialize process.

    You can change this behavior in publication properties.

    must the databases be the exact same in terms of schema etc?

    No, it must not. In transaction replication you can replicate either whole tables or some columns of those tables.