Groups | Blog | Home
all groups > sql server replication > october 2007 >

sql server replication : replicating schema changes



imarchenko
10/9/2007 2:36:46 PM
Hello!

I have setup testing transactional replication environment on my local
computer running SQL Server 2000. I was trying to test replication of schema
changes done to one of the tables participating in publication using command
similar to:

sp_repladdcolumn @source_object='Authors',
@column='Test4',@typetext='varchar(40) null', @force_reinit_subscription=1

According to BOL: 'In transactional replication, the schema change will
be propagated to Subscribers the next time the Log Reader Agent and the
Distribution Agent run' Unfortunately, this is not the case. Schema changes
are only replicated if I manually execute snapshot agent. My understanding
this could be very expensive for big databases as all tables participating
in publication (that could be potentially quite big) are refreshed on
subscriber from scratch. Am I missing something here?
Also, if I mark subscription for reinitialization in EM, it tells me that
'Reinitializating will occur next time the Snapshot Agent and Distribution
Agent run'. That tells me that Snapshot Agent has to be executed to
propagate schema changes.

Any comments are appreciated.

Thanks,
Igor


imarchenko
10/10/2007 10:52:33 AM
I found the answer. The key is @force_reinit_subscription. Once I set it to
0, changes were replicated without need to rerun snapshot agent.


[quoted text, click to view]

AddThis Social Bookmark Button