• DSNOSPAM (4/24/2015)


    I was just doing a table import task (right click database name/Tasks/Import Data), not knowing my boss had just loaded the same file. it did not warn me that the table currently existed. It just appended the same information to the same table, doubling it. I fixed that one, but, it seems that I might have done this myself in the last couple of weeks, and I'd like to find that table, and there have been a LOT of table loads.

    I'm thinking I could get the difference between tables by comparing:

    select distinct count(*) from tblname

    against

    select count(*) from tblname

    but how do I incorporate this into some sort of proc that will go through all the tables and let me know where the issue is? I'm swamped and don't have the time to go through each table manually.

    I have code that shows me row counts, and have been able to eliminate a few tables from contention, as they are loading monthly data that should only increase minorly month to month, so, no double jumps there.

    Thanks.

    There is a way to automate this. I just need to know...

    1) What determines if a row is a duplicate or not at the column level. For example, are there 1 or two columns that could be used to determine if rows are for the same thing? Hopefully it's not truly all the columns as your original post suggests but whatever. Be honest.

    2) Are there columns in the duplicate rows that temporally identify the order in which the dupes were entered/imported?

    3) What do you want to do with the dupes once we find them?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)