SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Join several records from diferent tables of a staging area in one table on the DW


Join several records from diferent tables of a staging area in one table on the DW

Author
Message
jcferreira.personal
jcferreira.personal
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 23
Hi,

I´m new using SSIS so I need help - thanks!


I´ve too tables A and B, and I need to create a C table with information of one of the tables.


Table A query

SELECT [PRODUCT_CODE]
,[DESCRIPTION]
,[PRODUCT_GROUP_ID]
,[SEASON]
FROM [DATA].[D_PRODUCT]


Table B query

SELECT [PRODUCT_GROUP_ID]
,[LONG_DESCRIPTION]
FROM [DATA].[D_PRODUCT_GROUP]


Table C query

SELECT P.[PRODUCT_CODE], P.[DESCRIPTION], P.[PRODUCT_GROUP_ID], G.[DESCRIPTION] DESCPROD, P.[PRODUCT_GENDER], P.[SEASON]
FROM [DATA].[D_PRODUCT] P, [DATA].[D_PRODUCT_GROUP] G
WHERE P.[PRODUCT_GROUP_ID] = G.[PRODUCT_GROUP_ID]


I need your help to learn how to implement this in SSIS?


The information off the A table is in a Flat File A.

The information off the B table is in a Flat File B.


In SSIS:

- I already read the A ff and put the data into a A table - in the satging area DB,


- I already read the B ff and put the data into a B table - in the satging area DB,


Now, what do I´ve to do to put the information I need in one C table in the DW DB?


Thank you.
José
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28057 Visits: 13268
You can either execute the SQL statement you provided in an Execute SQL Task, but put an INSERT INTO before it of course :-)
Or you could use the SQL statement in an OLE DB source in a dataflow and write the results to table C using an OLE DB Destination with fast load option.

Another alternative that doesn't use the staging database is reading the two flat files A and B in a data flow, sorting them and do a MERGE JOIN on PRODUCT_GROUP_ID and writing the result to table C. The sort is necessary as it is a prerequisite for the MERGE JOIN. If your files are very large, I would choose for the staging area.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search