locked
How to replicate Clustered indexes in Transactional replication. RRS feed

  • Question

  • Hello

     

    I have a question regarding the transactional replication.

    I want to replicate all the schema level changes, for example I have to replicate all the clustered indexes what should I do.

    I have set "replicate Schema level changes " to "TRUE". So every time when the index is created will it be automatically replicated?

    Or I have to manually create a new snapshot?

     

    I have also read about "sp_addscriptexec " which one would you recommend?

     

    Thanks in advance Wink

    Wednesday, July 9, 2008 9:05 AM

All replies

  • Which version of SQL Server are you working with? With SQL Server 2005, it is pretty easy. You can set the "Copy clustered index" option from the article properties to "true".

    Wednesday, July 9, 2008 3:34 PM
  • Thanks Jacob,

     

    I am using MSSQL 2005 and also checked the option "Copy clustered index" to "True". But the problem is it will only copy when we reinitilize and also it does not allows you to create indexes on publisher database. So we have to stop replication and create index. And then again start replication with reinitialize.

     

     

    Thursday, July 10, 2008 4:24 AM
  • Hi Kishan,

     

    I would recommend you to use sp_addscriptexec.

     

    Replication does not replicate add/modify/delete index automatically. Only if they are constraints (i.e. using ALTER TABLE), they are replicated.

     

    Peng

     

    Thursday, July 10, 2008 7:12 PM
  • Hi Peng

     

    is there a script by which we can re-initialize all the subscriptions?

     

    Thanks

     

    Wednesday, July 16, 2008 11:44 AM