I am working on migrating existing SSIS package generation framework to BIML, and faced with the task of migrating the following logic.
The framework (written in C#) creates an OLE DB Source based on metadata. Then, after instantiating the Data Source, it looks through output columns. If certain columns are present - the framework injects specific transformations like Lookup etc.
Example of that logic - OLE DB Source uses query
select quantity, salesdate, prcode as productid from salesfact
. Then code looks up for productid column and checks whether it has int data type. If this is the case - adds Lookup, which is defined by the lookup column ProductID, has fixed lookup query/cache and provides new column DimProductID.
The approach is quite dynamic, because OLE DB Source can have SQL Select statement from variable or with parameters. It runs correctly, doing an Instantiate()
call of OLE DB Source provides necessary columns in transformation metadata.
Question - can such dynamic approach be implemented in BIML? If yes - any insight or examples would be great. For now BIML seems fully declarative (i.e. all metadata has to be defined somewhere before BIML script run).
select quantity, saledate, productcode from table
, the current system would see the source component metadata has character data types and "know" that a lookup is required to translate that to a dimension key. The lookup table could be derived based on the text of the column name. Something like that? – billinkc