Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Is there a technique to identify reason for duplicates sql

Posted on 2016-08-11
6
Medium Priority
?
44 Views
Last Modified: 2016-08-11
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.
0
Comment
Question by:jamesmetcalf74
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Assisted Solution

by:Dustin Saunders
Dustin Saunders earned 500 total points
ID: 41752249
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
 
LVL 66

Accepted Solution

by:
Jim Horn earned 1000 total points
ID: 41752250
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
 

Author Comment

by:jamesmetcalf74
ID: 41752260
I will taketh thyne advice.  you are loyal dukes of the kingdom of MSFT SQL
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 66

Expert Comment

by:Jim Horn
ID: 41752262
Bless you my child.  Go forth and sin some more..
0
 

Author Comment

by:jamesmetcalf74
ID: 41752266
haha
thanks guys
0
 
LVL 52

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 500 total points
ID: 41752357
If all tables are in 3rd normal form then I would say you're missing some column joining.
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question