Are parameter variables read-only in the SSIS package?

I defined the parameters as shown below in my SSIS project

enter image description here

then I would like to change those that are optional for my sql agent given below.

enter image description here

even I tried setting the feed date value instead of getdate, but it returns an error message telling me that

Error: 2014-12-19 16: 30: 21.56 Code: 0xC001F016 Source: Package description: changing the value of a variable failed because it is a parameter variable. Parameter variables are read-only. DTExec termination error: could not install \ Package.Variables [startdate] .Value until 12/18/2014. Started: 16:30:21 Finished: 16:30:21 Expired: 0.296 seconds. Package execution failed. Failed to complete the step.

- read only options? if so, what is the point of using parameters, if I can only set them inside projects. there are variables, they will do the same job. If I am doing something wrong, please give me some light?

I tried to add getdate () instead of the fix value already at the project level, and not in the sql task, but it is also not allowed. What for?

thanks.

+6
source share
3 answers

I'm not quite sure that I am following your question, but you can solve this problem by making these variables and an expression with a value like this.

Expression

Getdate

0
source

you can pass the value of the variable parameter, add the necessary values ​​to the variable, and then use the variable in the package.

0
source

I just came across the same thing in VS2017 with the SQL Server 2012 compatibility level package. I had to remove all references to the variable from the Execute SQL task, remove it from the list of variables in the package, and then recreate the variable through the Execute SQL task as a new variable. This solved the problem for me. I think this is a mistake, because I could even see that the ReadOnly property of the variable was actually set to False . Playing with this flag did nothing.

Edit: It is detected that 1 is added to the variable name, and it does not use the variable that I intended. I could not find the variable name in the variable list in the package editor, so I opened it in notepad and found that the ReadOnly flag for the variable was actually set to True . Changing the flag fixed the problem.

0
source

Source: https://habr.com/ru/post/1209559/


All Articles