Solved

Is there a technique to identify reason for duplicates sql

Posted on 2016-08-11
6
30 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
6 Comments
 
LVL 12

Assisted Solution

by:Dustin Saunders
Dustin Saunders earned 125 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 65

Accepted Solution

by:
Jim Horn earned 250 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 65

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 45

Assisted Solution

by:Vitor Montalvão
Vitor Montalvão earned 125 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now