Add Primary Key To Replicated Table

Posted on 2011-10-04
Last Modified: 2012-05-12
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
Question by:Kilmiester
    LVL 23

    Expert Comment

    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.

    Author Comment

    If there was a duplicate rowguid I would have had replication failures.  But I ran a query anyways and 0 duplicates were returned.
    LVL 75

    Accepted Solution

    You will need to delete the article from Replication, make the correction and add it back in to the Publication.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now