Is there a technique to identify reason for duplicates sql

I have a query that joins 4 tables and i have duplicates.
I know what causes the duplicates but...
is there a technique that will key you in on the offending data.
jamesmetcalf74Asked:
Who is Participating?
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
Causes, no, SQL Server tables don't really store any auditing information on how/why/specifically what bad query JOINs/specifically what ETL jobs ran more than once/under what Zodiac sign rows were INSERTed into it, unless a developer either rolls their own auditing or impliment something like change tracing or change data capture.

BUT

Eyeballeth thy article SQL Server Delete Duplicate Rows Solutions for a T-SQL code and image-rich tutorial on how to detect and deal with duplicates.
0
 
Dustin SaundersConnect With a Mentor Director of OperationsCommented:
Generally, I'll start removing joins until I see the dupes disappear.  Then you can see what table is causing the problem, and go select info from that table to see where the cartesian product is coming from.
0
 
jamesmetcalf74Author Commented:
I will taketh thyne advice.  you are loyal dukes of the kingdom of MSFT SQL
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Bless you my child.  Go forth and sin some more..
0
 
jamesmetcalf74Author Commented:
haha
thanks guys
0
 
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
If all tables are in 3rd normal form then I would say you're missing some column joining.
0
All Courses

From novice to tech pro — start learning today.