Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

DTSxxxx90 and xxxx100 in one project

$
0
0

hello all,

right now we're dealing with migration from ssis2005 to 2008 and we have some c# sources where we use quite a lot DTSxxxx90 intrefaces. To move to ssis2008 we have to change it to xxxx100 versions (and of course add references to 2008 dlls).

But we would like to have for some time the same sources before finally migrating to 2008. One solution is to use old technique #if/#endif and to compile the project according to target ssis version. But that means adding #if/#endif to every place where interface is used which will be not very nice (although working) solution.

Can anybody suggest some good solution for this kind of problem?

 

For example, function like this:

public void AddCustomProperty(IDTSInputColumn90 inputColumn, string name, string description, object value, bool supExp)
{
           

            IDTSCustomProperty90 customProperty = inputColumn.CustomPropertyCollection.New();
            SetCustomProperty(customProperty, name, description, value, supExp);
}

 

can be rewritten like this:

 

#if SQL_2005

public void AddCustomProperty(IDTSInputColumn90 inputColumn, string name, string description, object value, bool supExp)

#else

public void AddCustomProperty(IDTSInputColumn100 inputColumn, string name, string description, object value, bool supExp)

#endif

{           

#if SQL_2005

            IDTSCustomProperty90 customProperty = inputColumn.CustomPropertyCollection.New();

#else

            IDTSCustomProperty100 customProperty = inputColumn.CustomPropertyCollection.New();

#endif

            SetCustomProperty(customProperty, name, description, value, supExp);
}

 

And that is not very nice :(

 

We've already tried inheriting interfaces, but that does not work either (you cant downcast after in the code from IDTSOutput90/100 to IDTSOutput_X)

#if SQL_2005

    public interface IDTSOutput_X : IDTSOutput90 { };
    ...
    ...

#else
    public interface IDTSOutput_X : IDTSOutput100 { };
    ...
    ...
#endif

for example this will not work i think:

IDTSCustomProperty_X customProperty = (IDTSCustomProperty_X) input.CustomPropertyCollection.New();

New is giving IDTSCustomProperty90 or 100, depending on version of ssis.

 

Any ideas?

thanks


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>