Friday, March 30, 2012

Reading a variable in a script taks used as source

Hi,

I'm using a script task as source and I need to read a global variable.

I tried stuff I found on the internet, but they all use Dts.VariableDispenser.LockForRead(varName)

This gives an errero on 'Dts.' saying it can not resolve it.

If you'd like, you can predict what variable you'd like to read or write to, you can use the ReadOnlyVariable or ReadWriteVariable properties to pass in the variable to your script. At that point, you won't need the variable dispenser. Then, you could read the variable by using code as easy as this:

LocalVariable = DTS.Variables("VariableName").Value

This video may help you as well: http://www.jumpstarttv.com/Media.aspx?vid=6

-- Brian Knight

|||Hi,

I've typed in the variables in the ReadOnlyVariables, but how can I access them in the script?

Also, 'LocalVariable = DTS.Variables("VariableName").Value' doesn't work (because it's a source script?). I get an error that VB is unable to resolve 'dts'.

I'm using folowing import:
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports Microsoft.SqlServer.Dts
Imports Microsoft.SqlServer.Dts.Runtime

Thank you

1 comment:

Blog27999 said...

Did you hear there's a 12 word phrase you can say to your partner... that will trigger deep emotions of love and instinctual attraction for you buried within his heart?

That's because deep inside these 12 words is a "secret signal" that triggers a man's instinct to love, cherish and look after you with his entire heart...

====> 12 Words Who Trigger A Man's Desire Impulse

This instinct is so built-in to a man's genetics that it will make him work better than ever before to take care of you.

As a matter of fact, triggering this dominant instinct is so mandatory to having the best ever relationship with your man that the instance you send your man one of these "Secret Signals"...

...You'll instantly find him expose his soul and heart to you in such a way he haven't expressed before and he'll see you as the only woman in the galaxy who has ever truly tempted him.

Post a Comment