Duplicatevalues for Primary Key | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Duplicatevalues for Primary Key

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?

This column cannot be PRIMARY KEY any more. You can either dedupe the duplicated value or create non-unique clustered/non-clustered index on the "PK" column, while adding another unique column to be the PK if required. Also, try to check again your source table, and look for the unique combination of columns to be the destination PK.
Aviel Iluz
Database Administrator
Pacific Micromarketing
Melbourne Australia
www.pacmicro.com.au

True, if you’re sure about the duplicate rows then delete them from 6.5 database before upgrading to SQL 2K. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>