Replication Articles without Losing Indexes

  • Hi ALL,

    I am using transactional replication. When I add articles and then click on generate snapshot now, it adds the new articles to the subscriber. The problem is it drops all the indexes that I had earlier on other articles. So each time I add an article I am having to re create the indexes. How should I avoid this ?

    Also I am using the GUI to do all this.

    Any help would be appreciated.

    Thanks,

    Suri

  • suri.yalamanchili (5/24/2011)


    Hi ALL,

    I am using transactional replication. When I add articles and then click on generate snapshot now, it adds the new articles to the subscriber. The problem is it drops all the indexes that I had earlier on other articles. So each time I add an article I am having to re create the indexes. How should I avoid this ?

    Also I am using the GUI to do all this.

    Any help would be appreciated.

    Thanks,

    Suri

    You are doing this through management studio. This method will reinitialise the subscription everytime and the default setting on a publication is to drop the existing objects (including indexes) when reinitialising.

    You are better off using sp_addarticle and sp_addsubscription as this will add the articles without the need to reinitialise.

  • FYI, I would generate the scripts for the publication using management studio to get a "template" proc execution with you local publication settings. Use one of these as the basis for adding a new article.

    Once, you've added the articles using these procs you will need to generate a snapshot.

  • Thanks.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply