SSIS - Passing Parameters to an ADO .NET Source query

给你一囗甜甜゛ 提交于 2020-01-02 05:37:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!