Friday, March 23, 2012

Pckg variable not getting set

I have created a simple package to zip a file. I am determining the file to be zipped dynamically at runtime using the Script task. I have a package variable defined as ReadWrite in the script task; I am attempting to store the dynamically determined file name to this package variable.

The code I am using to assign the value to the variable is:

Dim LatestBackupName As String

Dim ZipName As String

Dts.Variables("FileName").Value = ZipName & " " & LatestBackupName

I have set a breakpoint in the code to step into each statement. I am able to see that the "FileName" variable is being assigned the appropriate value. However, once the Script task completes, the value assigned to FileName is not stored in the variable. It is as if it gets the value during the script task and then loses it upon completion.

Am I going about setting the variable value wrong?

Any guidance is appreciated.

Nevermind. An answer to an unrelated post helped me figure this out. The variable was getting set - it just does not show it the way DTS would have. I set DelayValidation to TRUE to resolve the error I was receiving that I thought indicated the variable was not set.

No comments:

Post a Comment