Unique Constraint allowed duplicates??

  • I have a Unique index on a field called ITEMNMBR in a table. All except one itemnmbr is entirely unique. The one in question somehow exists 3 times in spite of the existence of the unique constraint. I'm completely lost and it has broken replication because the same constraint on the replicated version of the table won't allow the insert command to run.

  • Is the index/constraint enabled?

  • Touche' sir! Thanks. Now to fix this mess...

  • Any idea if it's safe to delete rows from distribution.dbo.msrepl_commands? I know the two rows I need to oust.

  • I would just delete them from your article and then reinitialize, if you can.

    Jared

    Jared
    CE - Microsoft

  • aurato (10/17/2011)


    Any idea if it's safe to delete rows from distribution.dbo.msrepl_commands? I know the two rows I need to oust.

    I never played there. But assuming the constraint is from ms, it might not be a bad idea.

    Now what side effects and steps from here, I have no idea.

  • I found a stored procedure that lets you mark rows to be skipped if they error

    sp_setsubscriptionxactseqno @publisher (name of publishing server),

    @publisherDatabase (name of publishing DB),

    @publicationName (self-explanatory),

    @xactseqno (xact_seqno of the offending query in msrepl_commands)

    Everything seems up and running now. Gotta fix the uniqueness issue but thanks. You've been on both threads where I asked for help. Last one involved replication too lol

  • Also, source http://technet.microsoft.com/en-us/library/ms188764(SQL.90).aspx

  • aurato (10/17/2011)


    Everything seems up and running now. Gotta fix the uniqueness issue but thanks. You've been on both threads where I asked for help. Last one involved replication too lol

    Doesn't mean I can't help ;-).

    As twice proven :-D.

Viewing 9 posts - 1 through 8 (of 8 total)

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