January 22, 2003 07:22 PM

Adding Columns to Replicated Tables

Rating: (0)
SQL Server Magazine
InstantDoc ID #37513

We often add columns to replicated tables. How can we add a column without having to reinitialize the entire publication?

In SQL Server 2000, you can use the sp_repladdcolumn stored procedure to add a column to a replicated table without reinitializing the entire publication because the stored procedure automatically adds the column at the subscriber. For example, if the authors table in the Pubs database has already been published, you can add the newcol integer column to tha...

...This article is for paid Professional Members only.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Professional Membership

Monthly

Annual

VIP Membership

Monthly

Annual

Add a Comment

This is in regards to your article on the Feb 2003 Issue for InstantDoc #37513 which is "Adding Columns to Replicated Tables". After reading up on this in MS SQL Books online, they claim that the subscriber will not get updated if you add a new column using this command as mentioned below. Where as your article says that it will automatically add the column to the subscriber.Can someone validate this since it is not documented by Microsoft and whether this was updated thru a service pack. Read the Excerpt from SQL Books Online as pasted below:
Remarks
sp_repladdcolumn is used for all types of replication.

When using sp_repladdcolumn, if a schema change is made to an article that belongs to a publication that uses a DTS package, the schema change is not propagated to the Subscriber, and the custom procedures for INSERT/UPDATE/DELETE are not regenerated on the Subscribers. The user will need to regenerate the DTS package manually, and make the corresponding schema change at the Subscribers. If the schema update is not applied, the Distribution Agent may fail to apply subsequent modifications. Before making a schema change, make sure there are no pending transactions to be delivered. For more information, see How Transforming Published Data Works.

Timestamp and computed columns will be filtered out for character mode publications. If adding a timestamp or computed column using sp_repladdcolumn, subscriptions of such publications will not receive this new column.



Important A backup of the publication database should be performed after sp_repladdcolumn has been executed. Failure to do so can cause a merge failure after a restore of the publication database.

Ravi Nanda 1/28/2003 1:11:04 PM


You must log on before posting a comment.

Are you a new visitor? Register Here
GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS