August 14, 2010 at 12:58 pm
Hi,
How to Get data from Different Sources Dynamically (ie.., One week from Excel and another week from Text File)
Thanks in advance
August 15, 2010 at 11:38 pm
Krishna,
Could you be more specific with your requirements?
Raunak J
August 16, 2010 at 12:29 am
You need a seperate data flow for each type of source. Even if you have 2 excel files but with different structure, you need 2 different dataflows. Then choose conditionally which dataflow to run.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
August 17, 2010 at 11:40 am
I created 2 variable . one for File location and one for flag to determine for file extension.
I wrote the following code in script task
if (DTs.Variables['Filelocation"].value.ToString()).Contains (".txt"))
DTs.Variables["isTxt"].value=True;
else
DTs.Variables["isTxt"].value=True;
i created 2 Data flow tasks (txt and Xls)
in the Precedence Constraints, i added expression @isTxt==True
Its works fine.
I just need to know is there any other best solution.
Thanks in advance
August 18, 2010 at 12:45 am
The solution you worked out seems fine to me.
You only need to make sure that no other .txt or .xls file comes in with a different metadata structure, as it would cause the package to fail.
You can also make it more robust:
- what happens if a .csv file comes in?
- you can add event handlers that clean up the files if there is an error
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply