November 24, 2008 at 2:51 pm
Hi
I am using Script task to assign a value to global variable.I am trying in this way
Dts.Variables("gvRunDt").Value = RunDt
Dts.Variables("gvPdDt").Value = PdDt
Dts.Variables("gvFileName").Value = StrFile
Here gvRunDt,gvPdDt,gvFileName,gvFilename are global variables ......i want to assign the value in run time.............
Thanks in Advance...........
November 24, 2008 at 3:04 pm
Make sure that you have specified these variables in the ReadWrite varible list under Script tab in Script Task Editor. The list should be comma seperated - e.g. gvRunDt,gvPdDt,gvFileName
November 24, 2008 at 4:21 pm
I did that But still i am unable to assign the values
November 24, 2008 at 4:57 pm
Maybe try this?
Imports Microsoft.SqlServer.Dts.Runtime
Public Class ScriptMain
Public Sub Main()
Dim vars As Variables
Dts.VariableDispenser.LockOneForWrite("vMyVar", vars)
vars(0).Value = "Hello World"
vars.Unlock()
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
[font="Courier New"]ZenDada[/font]
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply