Adding an Index (Clustered / Non-clustered to a replicating table

  • Hello,

    I would like to add indexs to a replicating table (Merge Replication).

    Can I add the indexes in the usual way?

     

    Thanks

    SM

  • Yes, I've done this before and it's relatively simple.  Just keep in mind that creating the index will block any updates on the underlying table, so it will hang replication if that is running.

    I recently moved some tables under replication to a different filegroup on a new RAID set by recreating the clustered primary key on the new filegroup.  I was pleased to discover it was much easier than dropping the subscription, removing the table from replication, moving the table to the new filegroup (via EM) and adding the table back to replication and reinitializing the snapshot.

    Dylan Peters
    SQL Server DBA

  • It's only if you modify the primary key you run into problems. secondary indexes are unaffected.

    If you can figure out the T-SQL ( rather than the gui ) making changes which replication doesn't allow is easier to achieve and more flexible. Note that you can change the indexes on the replicated tables ( at the replicated end ) independent of the source.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • Many Thanks for your replies.

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

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