• Ok the problem has nothing to do with partitioning. I still don't know what the problem is but at least I know partitioning isn't the cause.

    If I check the original table for duplicates based on the ID column there are none.

    SELECT <IdColumn>, COUNT(*) FROM <originalTable> GROUP BY <IdColumn> HAVING COUNT(*) > 1 -- no rows returned.

    If I query the original table for all rows with the particular ID value that SQL thinks is a duplicate I get only one row; no duplicates. Even trimming both sides of the nchar value or using "LIKE '%<value>%' still only returns one row in the original table.

    SELECT * FROM <originalTable> WHERE <IdColumn> = '<IdValue>' -- one row; no dupes.

    SELECT * FROM <originalTable> WHERE LTRIM(RTRIM(<IdColumn>)) = '<IdValue>' -- one row; no dupes.

    SELECT * FROM <originalTable> WHERE <IdColumn> LIKE'%<IdValue>%' -- one row; no dupes.

    If I script the table creation and run that to create a new table (specifying a new name obviously) and then try to insert into the new table I get the primary key violation error showing the key value that is not a duplicate:

    INSERT INTO <newTable> SELECT * FROM <originalTable> --"Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object '<newTable>'. The duplicate key value is (<IdValue>).

    ????? ANYONE: Any ideas?????