tag:blogger.com,1999:blog-13876521.post115894719987021950..comments2023-02-28T02:24:18.778-08:00Comments on Snapshots of Life, Faith and Work.: Delete Duplicates In One SQL StatementElliotthttp://www.blogger.com/profile/06550357851149950418noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-13876521.post-1166014762922146082006-12-13T04:59:00.000-08:002006-12-13T04:59:00.000-08:00Hi Elliott,Thanks a lot for your simple, quick and...Hi Elliott,<BR/>Thanks a lot for your simple, quick and easy solution.<BR/>I can only add that I used your code for a table without identity PK, the change here is pretty obvious:<BR/>1. Create identity PK<BR/> ALTER TABLE dbo.XXX<BR/> ADD pk INT IDENTITY(1,1)<BR/><BR/>2. Execute your code.<BR/>3. Drop PK<BR/> ALTER TABLE dbo.XXX<BR/> DROP COLUMN pk<BR/><BR/>Thanks.<BR/>--<BR/>AlexeyAnonymousnoreply@blogger.com