Inserting a flat file into a temporary table

342435 pts.
Tags:
Flat files
I need to take a flat file and insert it into a temporary table, then use that table to delete from another table all rows based on "col 7" of the temp table which may have duplicate values. Then from the temporary add to the perm table all rows. Do you have any suggestions, step by step for this NewBee? Thank you! Here is what it should look like data wise... FF Temp table Perm table Perm table Perm table "col7" after b/4 delete after delete after insert distinct ======================================================================== a a a a a b a a b c b b b d b b b b c c c c d d d d d d e e e e e e e e e

Answer Wiki

Thanks. We'll let you know when a new response is added.

Without knowing at least what database are you using, it is not possible to give you code samples.
Loading a file into a table will be different on different databases, and doing the deletions/insertions could be a little different depending also on the database.
It would also be useful to know the exact criteria when deleting based on col7 of temp table.

Please give some more details, and I’m sure you will get some useful responses.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • NewBee7
    Here is what it should look like data wise... FF-----------Temp table-----Perm table-----Perm table-----Perm table ---------------"col7" after-----b/4 delete-------after delete----after insert ---------------Distinct ======================================================================== A-------------A------------------A-------------------------------------------A A-------------B------------------A-------------------------------------------A B-------------C-----------------B-------------------------------------------B B--------------------------------B-------------------------------------------B B--------------------------------B-------------------------------------------B C-----------------------------------------------------------------------------C C-----------------------------------------------------------------------------C ----------------------------------D--------------------------D---------------D ----------------------------------D--------------------------D---------------D ----------------------------------E--------------------------E---------------E
    105 pointsBadges:
    report
  • Denny Cherry
    What database platform are you using?
    66,005 pointsBadges:
    report
  • NewBee7
    OK... I am in SQL 2005 and am trying to do this through SSIS. "Col 7" can have A,B,C and it it is found on the Perm table then I want to delete it. I hope that helps...
    105 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following