Sql-server – How to make snapshot for new tables only

replicationsnapshotsql server

If there is a replication running for a large set of data, and I want to add one or more new tables, I normally add the articles to the replication and start the snapshot agent.

Since there's a lot of data, this takes a while, interrupting users that do the normal operations on the database.

Is there a way to have the snapshot agent create the snapshot data only for these new (empty) tables?

Best Answer

There sure is. There are two settings on the publication that need to be set correctly to get the behavior that you want. allow_anonymous and immediate_sync must be set to false. You can change both with a call to sp_changepublication. Note that the tables needn't be empty for this to work.