Sql-server – SQL Replication for Schema changes

replicationsnapshotsql server

I want to configure the snapshot replication for all the articles. The problem iam facing is first time all the articles got sync on the subscriber. But later on let suppose if there is a schema change (added new table) in the publisher that newly created table is not getting replicated on the subscriber.

So every time if there a schema changes in publisher i have to manually update the selected articles on the publisher to get it replicated on the subscriber.

Is there a way to automate this step that whenever there is a schema changes at the publisher (added new articles) it should be automatically replicated on the subscriber ? Thanks

Best Answer

Is there a way to automate this step?

Sure. You can write a proc that uses sp_helparticle to compare the articles with the sys.tables, and then runs sp_addarticle to add articles for the new tables.

But there's no replication setting that will do this for you.