问题
I know this has been asked earlier.
Most of the answers were not relevant.
Google, shows that the solution is to configure the expression in the "data flow task" and set the query.
However in the ADO .NET source, when I try to preview the output I keep getting "Must declare the variable '@'"
It does not show the full variable in this error - "@[User::GLOBAL_PARAMETER]"
I think that's because "[USER::"
isn't the correct syntax inside a SQL; but then how does one set it ?!
回答1:
From your description it seems like you are having an error due to using the variable name inside the query string as opposed to the processed variable value. In other words:
"SELECT * FROM @[User::TABLE]"
in the expression builder would be WRONG
"SELECT * FROM " + @[User::TABLE]
would be CORRECT
It would help if you shared the expression you are using as a query
来源:https://stackoverflow.com/questions/8582211/ssis-passing-parameters-to-an-ado-net-source-query