Data import question - SQL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • narpet
    New Member
    • Oct 2006
    • 69

    Data import question - SQL

    Hello all...

    I have a (probably very) easy question for the SQL experts here...

    Lets say I have a table with the following rows and data:

    Code:
     Name       Nickname   Middlename
    ------------------------------------------------
    Rodney    Rod            Bob
    Now... I want to do an import of new data from a raw text file (or whatever)... that's easy... but is it possible to import the data into the table so that if there is a matching file like the one above, that file will be omitted? In other words, here's what my incoming data looks like before I import it:

    Code:
    Tom         Joe            Wayne
    Rodney    Rod            Bob
    Jim          Jack           Luis
    Rodney    Carl            Bob
    So... when I import the data I would end up with the following data in my table:

    Code:
    Name       Nickname   Middlename
    ------------------------------------------------
    Rodney    Rod            Bob
    Tom         Joe            Wayne
    Jim          Jack           Luis
    Rodney    Carl            Bob
    The ONE true duplicate would be omitted...

    I know this must be simple... any help???
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by narpet
    Hello all...

    I have a (probably very) easy question for the SQL experts here...

    Lets say I have a table with the following rows and data:

    Code:
     Name       Nickname   Middlename
    ------------------------------------------------
    Rodney    Rod            Bob
    Now... I want to do an import of new data from a raw text file (or whatever)... that's easy... but is it possible to import the data into the table so that if there is a matching file like the one above, that file will be omitted? In other words, here's what my incoming data looks like before I import it:

    Code:
    Tom         Joe            Wayne
    Rodney    Rod            Bob
    Jim          Jack           Luis
    Rodney    Carl            Bob
    So... when I import the data I would end up with the following data in my table:

    Code:
    Name       Nickname   Middlename
    ------------------------------------------------
    Rodney    Rod            Bob
    Tom         Joe            Wayne
    Jim          Jack           Luis
    Rodney    Carl            Bob
    The ONE true duplicate would be omitted...

    I know this must be simple... any help???

    if you can't do this on DTS, try uploading your text on a separate table then do the cleaning using query instead.

    Comment

    Working...