Select Distinct/Unique Rows from a Huge Table in SQL Server Without Timeout Errors

Posted by Maxim Z. on Server Fault See other posts from Server Fault or by Maxim Z.
Published on 2010-04-04T04:12:57Z Indexed on 2010/04/04 4:13 UTC
Read the original article Hit count: 466

Filed under:
|
|

I have a table in SQL Server with around 400,000 rows. Unfortunately, this table has many duplicate rows, as there isn't a primary key. I'm using SELECT DISTINCT to get all unique rows, but as there's so many of them, I keep getting timeout errors. What's the best way to approach this problem?

© Server Fault or respective owner

Related posts about sql-server

Related posts about sql