Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We recently dropped a computed column from a table that was participating in merge replication. After issuing the statement the other two computed columns remained in the table but stopped replicating out to the subscribers.

This became apparent while building a new subscriber I noticed that these other computed columns were missing and causing the snapshot to not apply since one of the views required these columns.

Checking the article list I could see those columns were available but the check box next to "publish" was missing on the selector. When I tried to add it manually it said I'd have to reinitialize every subscriber. Didn't want to do that as reinitializing takes a couple hours per client and there are over 30.

To get the columns to begin replicating again I decided to drop them ALL, and then add only the ones that I wanted.

ALTER Table Child DROP Column [Age]
ALTER Table Child ADD [Age] AS (floor(datediff(day,[DOB],getdate())/(365.25)))    
ALTER Table Child DROP Column [ChildFull]    
ALTER Table Child ADD [ChildFull] AS (IsNull([First],'') + ' ' + IsNull([Last],''))

Once complete - the computed column for ChildFull was included in the list of replication articles but Age was not. So I ran the DDL statements again like this.

ALTER Table Child DROP Column [Age]
ALTER Table Child DROP Column [ChildFull]    
ALTER Table Child ADD [Age] AS (floor(datediff(day,[DOB],getdate())/(365.25)))    
ALTER Table Child ADD [ChildFull] AS (IsNull([First],'') + ' ' + IsNull([Last],''))

After that everything was back and working no problem.

In three different attempts I was able to verify that dropping one computed column turns replication off for all other computed columns in the table.

I've posted this as a potential bug on Microsoft - let me know if anyone can offer reason as to why this is not a bug.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.