• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

Add Primary Key To Replicated Table

I goofed about a year ago when I created a table without a primary key set.  The full table is now an article in a merge publication.  I am now having issues with using it as a data service and I want to correct it.
Management Studio warns me about a validation error if I try and add a primary key to the table:

'CompanyListing' table
- Error validating the default for column 'rowguid'.

Is there an easy way to fix this or do I need cancel replication, fix the table, then republish?

BTW, it is SQL 2008 Workgroup Edition
1 Solution
Is it possible that you have a duplicate value for 'rowguid' in 'CompanyListing' and that's the core problem?  Perhaps if you fix that problem, you can create the proper index.
KilmiesterAuthor Commented:
If there was a duplicate rowguid I would have had replication failures.  But I ran a query anyways and 0 duplicates were returned.
Anthony PerkinsCommented:
You will need to delete the article from Replication, make the correction and add it back in to the Publication.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now