I just tried to apply a set of primary keys to a table and after a
very long time (like an hour or more) i got this error message ...
Unable to create index 'PK_master_data'.
ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE
UNIQUE INDEX terminated because a duplicate key was found for index ID
1. Most significant primary key is '2050500'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not create
constraint. See previous errors.
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been
terminated.
.... i am new to sqlserver ... is this saying to me that i have a
duplicate record? because when i query the recordset for duplicate
records i get none!
please help ASAP.
Thanks
Mogitcumming@.smorgonsteel.com.au (mogi) wrote in message news:<d1729549.0401272220.49ea5ee6@.posting.google.com>...
> Hi there,
> I just tried to apply a set of primary keys to a table and after a
> very long time (like an hour or more) i got this error message ...
> Unable to create index 'PK_master_data'.
> ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE
> UNIQUE INDEX terminated because a duplicate key was found for index ID
> 1. Most significant primary key is '2050500'.
> [Microsoft][ODBC SQL Server Driver][SQL Server]Could not create
> constraint. See previous errors.
> [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been
> terminated.
> ... i am new to sqlserver ... is this saying to me that i have a
> duplicate record? because when i query the recordset for duplicate
> records i get none!
> please help ASAP.
> Thanks
> Mogi
Yes, there are duplicates. How are you querying the recordset for
them? A query like this should find them:
select PrimaryKeyColumn, count(*)
from dbo.MyTable
group by PrimaryKeyColumn
having count(*) > 1
Simon
No comments:
Post a Comment