Making two tables into one

  • I am very new at SQL, but at my job I need to do some SQL. I am working on a SSIS package that combines 2 text files with data that is pipe delimited into one table. I have 1 table that has 2 pieces of information. Like...4000001|0002. I have another file that is pipe delimited that has 52 colums of information. The SQL table has 52 colums and 50 rows of info. I want to put in the two tables tables together.

    400001 0002 Thomas Industries Dean Sale .....

    400001 0002 Part number ....

    I want to put the info 400001 0002 on each row of the table when it is imported. The number will change on each import and it is not sequential. I hope this is understandable. PLEASE HELP ASAP!!!

    Clark

  • I have a picture of what it is doing, but I don't have a sollution yet. If anyone would be interested in helping me figure this out I can e-mail the pic to show what I am talking about.

  • Do you have any way to relate the rows in the table to the ones in the file?

    http://sqlvince.blogspot.com/[/url]

  • Yes, I have a sorted package running in ssis. But the problem is that the first text file has only 2 colums and 1 row. The second has many colums and many rows. I want the 2 colums in the first text file to populate as many rows as it has with the 2 colums all the same data. This will create the 1 to many later in SQL. I just need to populate the columns.

    Does that make sense?

  • Hi

    since you're only expecting one record with two fields from the first file, you can create two variables and assign those fields to the variables and then pull data from the second file and derive the two variables as additional columns and insert into the table.

    hope this helps 🙂

    Kabelo

  • I got it, I was trying to use 2 tables in the sort . One was popluated and the other was not. I did it over and everything seems to be working. THANKS

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply