Results 1 to 5 of 5
  1. #1
    Join Date
    May 2002
    Location
    Timbaktu
    Posts
    185

    Unanswered: Table with Duplicate Entry with Primary Keys

    We have a SQL Server 6.5 table, with composite Primary Key, having the Duplicate Entry for the Key. I wonder how it got entered there? Now when we are trying to import this table to SQL2K, it's failing with Duplicate row error. Any Help?

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I don't have a clue how it got duplicated. If you don't care which copy you use, just pick one of them (use SELECT DISTINCT). If you want to preserve both copies, you need to decide how you want to preserve them because you'll have to change something in the PK in order to keep both rows.

    -PatP

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Well you can bcp in all the dup keys you want....

    How are you migrating the data?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by Brett Kaiser
    Well you can bcp in all the dup keys you want...
    That's a bug, not a feature!

    -PatP

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by Pat Phelan
    That's a bug, not a feature!

    -PatP
    You sure?

    And I've grown so accustomed to dismissing ALL of the flaws by calling them unintended features....

    Did any of the techs take any relational design classes?

    I thought there was a switch...but I can't find it now...

    Need to do DBCC CHECKCONSTRAINTS
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •