November 26, 2008 at 7:27 am
Hi
I am assigning value to global variable using script task
Dts.Variables("gvRunDt").Value = RunDt
Here "gvRunDt" is global variable to which i want to assign a value at run time .The value comes from RunDt
I am using this
Dts.Variables("gvRunDt").Value = RunDt
But i am unable to assign the value.Please let me know is there any way to assign a value to global vairable
Thanks
November 26, 2008 at 7:45 am
sudheer_1185 (11/26/2008)
HiI am assigning value to global variable using script task
Dts.Variables("gvRunDt").Value = RunDt
Here "gvRunDt" is global variable to which i want to assign a value at run time .The value comes from RunDt
I am using this
Dts.Variables("gvRunDt").Value = RunDt
But i am unable to assign the value.Please let me know is there any way to assign a value to global vairable
Thanks
When you say you are unable to assign a value, what do you mean? Do you receive an error in your package or does the value not get updated? I assume that RunDt is a variable you are declaring elsewhere in your script task, is it possible that this value is NULL or represents an incompatible data type?
Tim Mitchell
TimMitchell.net | @tmitch.net | Tyleris.com
ETL Best Practices
November 26, 2008 at 7:50 am
You are write RunDt is already declared and i am getting value from substring fun.I want to assign that value to the "gvRunDt" which is global variable.
November 26, 2008 at 8:00 am
Again, how is it that you determine that there is a problem? Does your package fail or are you getting incorrect output?
You might also post some of your script code here to help troubleshoot.
Tim Mitchell
TimMitchell.net | @tmitch.net | Tyleris.com
ETL Best Practices
November 26, 2008 at 8:09 am
Error: The type of the value being assigned to variable "User::gvRunDt" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.
This is the error iam getting.I decalred "gvRunDt" as String and gvRunDt as String.
SUDHEER
November 26, 2008 at 8:14 am
Check your variable declaration by right-clicking in your control flow pane and choosing Variables. Make sure that you have set your SSIS variable to be of type "String". The default data type for SSIS variables is Integer, fyi.
Tim Mitchell
TimMitchell.net | @tmitch.net | Tyleris.com
ETL Best Practices
November 26, 2008 at 8:18 am
I have Declared that variable as String in package variable....But still i m facing the error..
November 26, 2008 at 12:19 pm
Can you post your script code?
Tim Mitchell
TimMitchell.net | @tmitch.net | Tyleris.com
ETL Best Practices
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply