August 8, 2013 at 4:04 pm
I have an SQL table called RETAIL_SALES that contains the columns: DATE,STYLE,QTY. Using SSIS, I populate RETAIL_SALES using an Excel data source that contains only STYLE & QTY. I have another SQL table called SALE_PERIOD that simply contains 1 record with a date. In addition to RETAIL_SALES.STYLE & RETAIL_SALES.QTY from the Excel file, how do I update RETAIL_SALES.DATE with SALE_PERIOD.DATE for each record imported from Excel?
August 9, 2013 at 12:07 am
You could use an Execute SQL Task before the data flow.
In the SQL Task, you retrieve the data and put it in a variable.
Inside the data flow, you use a derived column to add a column to the flow with the value of the variable.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
August 12, 2013 at 4:14 pm
JayWinter (8/8/2013)
I have an SQL table called RETAIL_SALES that contains the columns: DATE,STYLE,QTY. Using SSIS, I populate RETAIL_SALES using an Excel data source that contains only STYLE & QTY. I have another SQL table called SALE_PERIOD that simply contains 1 record with a date. In addition to RETAIL_SALES.STYLE & RETAIL_SALES.QTY from the Excel file, how do I update RETAIL_SALES.DATE with SALE_PERIOD.DATE for each record imported from Excel?
How would you do it without using SSIS, assuming that you have both sets of data in the database. I am with Koen and would use an SQL task to run the following query
UPDATE RETAL_SALES SET DATE = (SELECT DATE FROM SALE_PERIOD) WHERE RETAIL_SALES.DATE IS NULL
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply