SSIS Foreach Loop with specific flat files

做~自己de王妃 提交于 2019-12-11 08:47:44

问题


I am trying to import different csv files from a folder containing different csv file types. So I need to filter my foreach loop with the starting flatfile name. I only want to process files starting with MyFileType_1*.csv and not the others in the same folder. Any suggestion is welcome, thanks.


回答1:


In your for-each container can specify which files to read as Ocaso is saying. In the Variable mappings tab in the for-each container you can there set which variable you want to save the files found. Then you can use this variable as the connection string to a flat file connection.




回答2:


Nighty_'s answer is correct, but just for the sake of completeness it is worth mentioning that to set the ConnectionString in a Flat File Connection you must use a variable of package-level scope in the expression (in his case @[User::v_FilePath]). This is because the connection itself is package level. This might feel a bit unintuitive... or ugly... it is.



来源:https://stackoverflow.com/questions/19243893/ssis-foreach-loop-with-specific-flat-files

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