SSIS connection parameter based on parameter/variable

↘锁芯ラ 提交于 2019-12-12 04:17:00

问题


I am building an SSIS project to import ~40 CSV files. I am creating one package for each import and a master package to run them all.

The CSV files all live in the same file location, but that location may change. What I would like to do is set a project-level parameter for the file location and construct the connection string for each package's connection by concatenating that project-level parameter with the file name.

Is this possible?


回答1:


You concatenate variables in SSIS with Expressions. To get to the screenshot below, I created VarA, and gave it a simple string value.

Then I created VarB, made it a string type, and clicked the ellipses in the Expression box:

You can see in the image how I then concatenated the first variable with some text to make the second variable.

So to apply to your question, use the Package-level parameter (file location) as VarA, and in each package, use this technique to build VarB with the file name for that package.

My example is actually backwards in relation to your goal since I put the file name in the first variable. But it demonstrates how to concatenate string variables.



来源:https://stackoverflow.com/questions/35181719/ssis-connection-parameter-based-on-parameter-variable

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