sql server data warehouse:
Somehow primary constraint was violated as group by
clause to eliminate dupplicates does not catch the
invalid date until attempt to insert data into
destination table:
Where clause produces the dupplicate row
"CONVERT(VARCHAR(50),sales_dt,101) = '10/23/2003'" but I
am unable to see the dupplicate and produces the two rows
2003-10-23 00:00:00.000
2003-10-23 00:00:00.000
However this where clause "sales_dt = '10/23/2003'"
eliminates the dupplicate in the result set and only
produces a single row
2003-10-23 00:00:00.000
Huge problem don't know which row to delete and primary
key is now violated on a table of over 120 million rows.
Running DBCC REINDEX fails now due to the violation in
primry key.