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


Create or modify a mapping in a DFT depending on the column value


Create or modify a mapping in a DFT depending on the column value

Author
Message
Paul Hernández
Paul Hernández
Old Hand
Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)

Group: General Forum Members
Points: 388 Visits: 661
Hi friends,

I already asked this question some weeks ago, but how would you add a column to a DFT depending on its value?

I'm using the Data Flow Tas Plus component from CozyRoc. As long as I've understood, this component dynamically manages the metadata. The example in the CozyRoc Website shows how to insert data in a table from Flat Files with different column names.

In my case, all of the columns have the same names and are always present, I just want drop a column from the data flow depending on its value. For instance, if the field emailaddress is null or empty, don't map the column to the destination.

Is this possible?

I`m thinking in a script component that add rows to the dataflow using the correspondent API, but I'm no able to see the light at the end of the tunnel.

Could someone please suggest something?

Kind Regards,

Paul Hernández
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18736 Visits: 20452
So do you mean that somehow you will check all of the data values in all of the columns, looking for those columns which do not contain any values at all, and then unmap those columns?

That would require reading the file twice and (I would guess) would take longer than just leaving the blanks in there.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Paul Hernández
Paul Hernández
Old Hand
Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)

Group: General Forum Members
Points: 388 Visits: 661
Hi Phil,

Thanks for your quick answers.

In my case the source is a OLE DB component, and the reason to do such a things is the final destination is a Dynamics CRM.

I think the problem is, I´m trying to implement some logic in the ETL side that should be implemented by the CRM developers, but at the end we should determine the simple way for everyone.

Paul Hernández
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18736 Visits: 20452
Paul Hernández (4/15/2013)
Hi Phil,

Thanks for your quick answers.

In my case the source is a OLE DB component, and the reason to do such a things is the final destination is a Dynamics CRM.

I think the problem is, I´m trying to implement some logic in the ETL side that should be implemented by the CRM developers, but at the end we should determine the simple way for everyone.


So if a column contains 999 nulls and one actual value, that is fine. But 1,000 nulls and you want to lose the column mapping?

Sounds somewhat strange, tbh.

This dynamic (not 'Dynamics'!) mapping will take up a chunk of valuable development time to create a complex solution that ultimately will perform slower (from a SQL Server standpoint anyway) than the simple version. Have you no other choices?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
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