Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2011-01-31 : 06:28:06
|
Hi,Just after some advice here.I have currently an ETL that scans a folder and checks the files in the folder are to 'standard' for loading.The next step is to try upload that file to see if the contents meet 'standard'. But the problem is, there are 2 types of files, supplier and purchase. Both have different fields.How can i get SSIS to create a table based on the fields present in the file (so no preset function) is that possible?Thanks |
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2011-01-31 : 07:06:29
|
You could have two file definitions and two dataflows, and use a script task to evaluate the 1st row of data to populate a variable which identifies which of the two dataflow to use. you could have two variables, one for @standardflag boolean, @purchase boolean...setting one to TRUE and one to FALSE. You could use this variable as a property expression on the "Disable" property of the dataflows. If it is standard, set that boolean to FALSE and the other to TRUE so that the Purchase dataflow is disabled and won't run. The opposite setting for standard.Is there no way to use the file NAME? you could then do a foreach loop and specify the file name constant in the criteria of the loop..There are some rather inventive ways to dynamically create the metadata in a data flow, but that is not as easy. Poor planning on your part does not constitute an emergency on my part. |
|
|
cipriani1984
Constraint Violating Yak Guru
304 Posts |
Posted - 2011-01-31 : 08:54:40
|
Ive figured out a solution.My problem is im trying to get on a SQL Task the return of the query in there to be output onto a SSIS variable.Im having trouble doing that now, how would I go about doing it?Ive set in the parameter mapping the variable to output but its not liking. |
|
|
dataguru1971
Master Smack Fu Yak Hacker
1464 Posts |
Posted - 2011-01-31 : 12:44:35
|
You have to map within the SQL task. Set to a single row result return (instead of NONE), and map in the SQL Task properties under "result set". You map the SQL query column names to their designated variable assignments. Poor planning on your part does not constitute an emergency on my part. |
|
|
|
|
|