Select Distinct/Unique Rows from a Huge Table in SQL Server Without Timeout Errors
- by Maxim Z.
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?