adding new column in existing article

  • Hi ,

    i have to add one more column in my existing articles so i have two queries:

    1. how should i stop my replication for this process

    2. will i have to give full snapshot after adding the column and data into it or it will be done only after re-initialize the subscription and rerunning of distributor agents.

    is there any way to avoid full snapshot since db size is very big ,like if i create that column on subscriber also then ....

    My Replication is 'Push'

    Thanks .

     

  • You can add columns without removing the replication by using the sp_repladdcolum stored procedure. Check BOL for the full syntax.

    If you need to stop replication anyhow you have the option of not initializing the subscriber. I'f I remember it right it's one of the advanced options in the wizard and called something like "do not intialize, subscriber already has the schema and data".

    M

    [font="Verdana"]Markus Bohse[/font]

  • Can you please guide me how to stop replication for some time,i dont want to disable the replication.

    and can i avoid full snapshot after adding/Changing the column?

    or if i cant avoid the snapshot ,will it take full articles data or only changed article data?

    Thanks

     

  • There is no need to resincronize with a snapshot.

    The sp_repladdcolumn sp, adds the column in the publisher and also in the subscriber.

    Microsoft says that you need to stop replication, because if you don't you will have transactions with doesn't include this new column, and transactions that include the new column. But, because in the subscriber, the sp already added the column, then the first transactions (the ones that doesn't include the new column) will fail.

    To avoid this, if you are using sp in replication, then you can change the sp, adding a new variable (as a new column) with a default value like NULL. With this, the old transactions and new transactions won't failed, so you don't need to stop replication.

  • that's true i am getting column at subscription also but i am not getting new data for that column in subscription ,which i am getting only after running snapshot again.

    any clue?

Viewing 5 posts - 1 through 5 (of 5 total)

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