General information
Forum:
Microsoft SQL Server
>I have a table from a client that never got a primary key put on the id field. There are 700 duplicate records where every field including id is duped. Is there any automatic way to rid these so that I can define a primary key on this id field? I know how to get a list of the dupes.
>
>Does adding an idx primary key field with seed 1 step 1 help?
How about:
delete from table_name where pk_column in (select pk_column from
table_name group by pk_column having count(*)>1);
Works on Oracle but maybe the sql server syntax is different?
HTH
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only