Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Create or modify a mapping in a DFT depending on the column value Expand / Collapse
Author
Message
Posted Monday, April 15, 2013 6:51 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 6:51 AM
Points: 120, Visits: 490
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
http://hernandezpaul.wordpress.com/
https://twitter.com/paul_eng
Post #1442284
Posted Monday, April 15, 2013 6:55 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 11:02 PM
Points: 5,259, Visits: 12,193
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1442285
Posted Monday, April 15, 2013 7:15 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 6:51 AM
Points: 120, Visits: 490
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
http://hernandezpaul.wordpress.com/
https://twitter.com/paul_eng
Post #1442293
Posted Monday, April 15, 2013 7:39 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 11:02 PM
Points: 5,259, Visits: 12,193
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.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1442298
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse