..dts NG so I took it to be DTS. Tasks have no way of seeing each other.
package. The way I would do this in SSIS (and have done) is to register
an external assembly. This assembly will have the methods you need. This
> Hello Allan,
>
> Sorry for replying little late. Last 2-3 days I was too much occupied
> as I had Phase1 release of my Integration Package.
>
> In continuation to your reply.....
>
> I tried your solution but there is no class called
> 'DTSGlobalVariables' in SSIS 2005, I guess you have provided soln for
> DTS 2000 or forget to mention any namespace, I need to include in
> Imports section.
>
> Actually, what I wanted to know was, some way to call a function in a
> script Task in 'SSIS 2005 Package' from other Script Task in same
> package.
>
> In my last post I forgot to mention 'for SSIS 2005' ....
>
> Is there any way I can acheive this??
>
> Plz let me know.
>
> Thanks,
> Sachin R. Chavan.
> "Allan Mitchell" wrote:
>
>> Hello Sachin,
>>
>> In DTS you can certainly do this.
>>
>> Imagine this
>>
>> In a script task I have this
>>
>> Function Main()
>> Main = DTSTaskExecResult_Success
>> End Function
>> Function X(Y, Z)
>>
>> X = Y + Z
>>
>> End Function
>>
>> This task is disabled
>>
>> I have another script task which will now call the function X from
>> the first script task and retrieve the value
>>
>> Function Main()
>>
>> dim ax,i,str
>>
>> set ax =
>> DTSGlobalVariables.Parent.Tasks("DTSTask_DTSActiveScriptTask_1").Cust
>> omTask
>>
>> Execute(ax.ActiveXScript)
>>
>> i = X(1,99)
>>
>> Msgbox(CStr(i))
>>
>> Main = DTSTaskExecResult_Success
>> End Function
>> --
>>
>> Allan Mitchell
>>
http://wiki.sqlis.com |
http://www.sqlis.com |
http://www.sqldts.com >> |
>>
http://www.konesans.com >>> Hello,
>>>
>>> Can I call a Script Task from Other Script Task?
>>>
>>> Actually, what I am trying to acheive is:
>>>
>>> I have a piece of code Like some Functions that I keep using over n
>>> over in all of my script task e.g. functions for Reading n Writing
>>> Package Variables and Instantiating some .Net Objects.
>>>
>>> Now, If 2morrow something changes to this common stuff used
>>> everywhere I need to edit each n every Script Task.
>>>
>>> So, for the sake of maintainability, I want all the common stuff in
>>> one Script task n I will keep calling the required function out of
>>> it e.g. read/write as and when required from my rest of the script
>>> Tasks.
>>>
>>> Is this possible??
>>>
>>> Plz Plz do provide the code for the same, if this can be acheived.
>>>
>>> Thanks,
>>> Sachin R. Chavan.