November 15, 2005 at 4:24 am
In 2005 I am trying to pass a parameter to a package variable, and then pass this variable to child packages that are being executed from within this parent package. I am getting an error message 'error occured while assigning a value to variable' Also variables are not being recognised by child packages that have been executed within the parent package that holds the variable. If anyone could provide me with a quick example of use it would be appreciated.
November 16, 2005 at 2:12 am
Janette,
How are you attempting to "pass this variable to child packages that are being executed from within this parent package"? Are you using a parent package configuration?
-Jamie
Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
November 16, 2005 at 2:52 am
Hi Jamie,
Yes I am using parent package configuration. setting the configuration from the child and refernecing the var in the parent package. one other question. does the variable in each package level have to be named differently in order to pass the variable down?
Thanks Janette
November 16, 2005 at 3:06 am
Janette,
No, you shouldn't need to do that.
I'm struggling to see why this wouldn't work. Are the datatypes on the variables identical?
-Jamie
Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
November 16, 2005 at 10:02 am
Yes I am using parent package configuration. setting the configuration from the child and refernecing the var in the parent package. one other question. does the variable in each package level have to be named differently in order to pass the variable down?
Parent Package configurations work top down, from parent package to child, not the other way around. So, you probably just want to reference the parent package variables, modify them as needed. They will be visible to you from the child package.
November 17, 2005 at 8:45 am
me again... think i have manged to get the var scoping working (had a look at some of your associated articles) However, I have just noticed that the correct value is not being held in the parent package variable. I have an execute sql task and wanted to pass the output param to a package variable. rather than the other way round. What is the best way to do this? thanks Janette
November 17, 2005 at 9:31 am
I don't know much about this because I've never had to do it but I do know that Kirk has a very useful post here: http://www.sqljunkies.com/WebLog/knight_reign/archive/2005/10/05/17016.aspx that explains some of the syntax needed to do this based on what provider you're using to access the data.
-Jamie
Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
November 17, 2005 at 9:49 am
Hi Jamie,
setting up the sql task parameter is fine. just have a simple query declare @LRun datetime
set @LRun = (select * from JobStore)
Param mapping:var name - LRun, direction - I, Data Type - Date, Param Name - @LRun
However I thought that it's use was parameter input to package variable rather than the other way round. so what I need to find out is if this can be done through execute sql task or is another item used to do this.
Thanks Janette
November 18, 2005 at 10:36 am
any other thoughts/suggestions on this?
Thanks janette
November 21, 2005 at 5:58 am
got the param passing to package variable working. Within Execute SQL Task, I had been trying to use parameter mapping to output a parameter rather than the result set functionality on it's own. Thanks Janette.
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply