If your temporary table has a primary key column, then there is an alternative to copying the distinct rows into a temp table, deleting the source table then copying things back.
Let's assume you assigned an identity column as the primary key ('keycol' in my code below), and let's further assume you'd be happy to retain the first (lowest primary key value) row for any duplicates:
Code:
DELETE FROM YourTable
WHERE keycol NOT IN
(SELECT MIN(keycol)
FROM YourTable
GROUP BY Col1);
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com