Has anyone found a proper way to set a declared variable in an "Execute SQL Task" to an incoming Global Variable parameter?
If I use the following script:
Declare @var1 as varchar(10)
SET @var1 = ?
I get a "Syntax error or access violation" error when trying to open the parameters window.
If I fake it out by using a select statement like this:
Select *
from table1
where table_ID = ?
the task allows me to retrieve the parameters window. I can then paste the original code into the window and it works.
Is there a better (proper) way to retrieve parameters into a declared variable that I am not aware of?
If I use the following script:
Declare @var1 as varchar(10)
SET @var1 = ?
I get a "Syntax error or access violation" error when trying to open the parameters window.
If I fake it out by using a select statement like this:
Select *
from table1
where table_ID = ?
the task allows me to retrieve the parameters window. I can then paste the original code into the window and it works.
Is there a better (proper) way to retrieve parameters into a declared variable that I am not aware of?