I have a table which has 2 coloumns Class and RollNo. Class(varchar) RollNo(int) Class1 101 Class2 104 Class1 116 class5 304 I want to create the below directory structure in my shared location like \\disk1\pathxyz\Class1\101 \\disk1\pathxyz\Class2\104 \\disk1\pathxyz\Class1\116 \\disk1\pathxyz\Class5\304 Note:Class1 folder will have 2 subfolders 101,116 Any ideas how this can be done using Script task in SSIS?
Why would you want to use a script task? It can be done fairly easily using the Foreach Loop container to loop over your folders to be created. Here's what I'd do: 1. Create a **Execute SQL task** (Control Flow) that retrieves your data into a package variable 2. Attach a **Foreach Loop** to loop over the ADO recordset 3. Inside the Foreach Loop, use one or several **File System tasks** to create the folders as expected. You could have one that creates the *Class* folder, followed by another one that creates the *RollNo* subfolder. For more details on how to loop over a dataset in SSIS, please refer to the following article: [