2
votes

I have a Variable which uses another variable to get its value. I had set the EvaluateAsExpression property to True. Now when I use this variable in a Script task it is taking 2-3 Minutes to evaluate that expression. But if I Hard Code the variable value instead of reading it from another variable then it is finishing in less than a Second. Anyone let me know if I am missing anything ? I am using BIDS/SSIS 2008

Variable1: D:\app\srikar.mogaliraju
Variable2: @[User::Variable1]+"\\Product"

Script Task Code:

        public void Main()
        {

            String SourceFolderPath, DestinationFolderpath;
            SourceFolderPath = Dts.Variables["User::Variable2"].Value.ToString();

//Random Code
 Dts.TaskResult = (int)ScriptResults.Success;
        }

Variable 2 Expression Builder: enter image description here

1
What is the expression it? But I would say the machine it is running on is under-powered.Arthur
@Arthur Added the expression in my question.Srikar mogaliraju
Set it up outside the Script Task @SrikarArthur
@Srikarmogaliraju Why are you using a script task to set another package variable's value. You can do this in the Package Variables Expressions property. This is both easier and simpler.J Weezy
@Srikarmogaliraju It might be more helpful if you post the script task code so we can look at it and try to diagnose the problem.J Weezy

1 Answers

0
votes

I haven't got any solution for this. So posting the answer with the solution I implemented to bypass this problem.

  1. Use ExecuteSqlTask to read Variable1 and Append "\Product" to Variable1 value.Set the result set property to Single Row.
  2. Assign the Result Set to Variable2 and use this Variable in Script task.