Ah, you are right. You can add an IDENTITY column to the table after the SELECT INTO, which will act as the index. But by this time you might be better off adding the IDENTITY column to the source table (with dups), then INSERT INTO a new table like:
INSERT INTO Table_NoDups
(keyCol1, col1, col2)
SELECT keyCol1, col1, col2
FROM
Table_WithDups
WHERE identityCol IN
(SELECT MAX(identityCol) FROM Table_WithDups
GROUP BY keyCol1)
But by this point, I'm not sure what the performance gains would be... 😉
---------------------------
|Ted Pin >>