How could I add multiple file extensions to the Files: input field in the Foreach loop container in SSIS 2008.
I have currently entered as *.zip
OR .c
I don't think you can specify two file type extensions in a For each Loop container
, you should use *.*
and you can filter for a specific extensions by using the following steps:
User::Flag
)script task
inside the container and mark Filename
variable as Readonly , Flag
variable as ReadWrite
Inside the script write the following script
Public Sub Main()
Dim strFile As String = Dts.Variables.Item("Filename").Value.ToString
Select Case IO.Path.GetExtension(strFile).ToLower
Case ".csv", ".zip"
Dts.Variables.Item("Flag").Value = True
Case Else
Dts.Variables.Item("Flag").Value = False
End Select
Dts.TaskResult = ScriptResults.Success
End Sub
Add an expression to the Script task
output connector like shown below
Or you can achieve it by using a Third-party components like Foreach File Enumerator with regex