HI ,
I accidently removed the primary keys from my table by mistake. Is there anyway ,That i can get the PK's back to what is used to be. Need Help pls..... When I try "resetting" the PK I kep getting this error:
'table_name' table
- Unable to create index 'PK_tablename'.
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 '1'.
[Microsoft][ODBC SQL Server Driver][SQL Server]Could not create constraint. See previous errors.
[Microsoft][ODBC SQL Server Driver][SQL Server]Warning: The table 'tDetail' has been created but its maximum row size (12521) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.Before recreating the index you should handle all the rows that do not stand in the index condition (create duplicate- the Error root cause) .
You should do it by:
1. delete those rows
2. group by those rows
3. change Id of those rows|||Thanx for the help..but how do i do that?|||Thnx for the help...but how do I do that ...do I first delete all duplicates form the server and then re-assign the primary keys?
Yes !
1. first delete
2.re-assign the primary keys|||Originally posted by eschapir
Thnx for the help...but how do I do that ...do I first delete all duplicates form the server and then re-assign the primary keys?
Yes !
1. first delete
2.re-assign the primary keys
thanx
No comments:
Post a Comment