This Video Tutorial illustrates how to use From Variable enumerator to loop through an array list.
From Variable provides ability to loop through an array that filled from a script task. Collection structures such as Array and ArrayList can be loaded into an Object type variable in the SSIS package, and then Foreach Loop with From Variable Enumerator can loop through the variable.
In this sample we use From Variable Enumerator for following scenario:
Source CSV files come into a source directory. we want to load data from each source file into a database table, and then move that file into the archive folder. But we want to do the data load for only new files.
We use a script task to find new files based on System.IO namespace objects, and then we will load new file pathes into an array list, then the array list will be loaded into an Object type varaible of the package. Finally we use a Foreach loop with From Variable to loop through items of that array list, and load new files into the database table, and then archive them.
Reza Rad is a Microsoft Regional Director, an Author, Trainer, Speaker and Consultant. He has a BSc in Computer engineering; he has more than 20 years’ experience in data analysis, BI, databases, programming, and development mostly on Microsoft technologies. He is a Microsoft Data Platform MVP for nine continuous years (from 2011 till now) for his dedication in Microsoft BI. Reza is an active blogger and co-founder of RADACAD. Reza is also co-founder and co-organizer of Difinity conference in New Zealand.
His articles on different aspects of technologies, especially on MS BI, can be found on his blog: https://radacad.com/blog.
He wrote some books on MS SQL BI and also is writing some others, He was also an active member on online technical forums such as MSDN and Experts-Exchange, and was a moderator of MSDN SQL Server forums, and is an MCP, MCSE, and MCITP of BI. He is the leader of the New Zealand Business Intelligence users group. He is also the author of very popular book Power BI from Rookie to Rock Star, which is free with more than 1700 pages of content and the Power BI Pro Architecture published by Apress.
He is an International Speaker in Microsoft Ignite, Microsoft Business Applications Summit, Data Insight Summit, PASS Summit, SQL Saturday and SQL user groups. And He is a Microsoft Certified Trainer.
Reza’s passion is to help you find the best data solution, he is Data enthusiast.