[Solved] Enumerate files in a folder using SSIS Script Task [closed]

Configure two variables: read-only string User::download_path and read-write object User::files_to_process to receive the list of files. public void Main() { bool fireAgain = true; var filesToProcess = new System.Collections.ArrayList(); var filesInDirectory = new System.Collections.ArrayList(); var download_path = (String)Dts.Variables[“User::download_path”].Value; // Find for example all csv files in the directory which are having size > 0 var … Read more

[Solved] String cannot be of zero length error [closed]

You need to check if the area contains a hyphen. Otherwise Row.Area.Substring(0, Row.Area.IndexOf(“-“) + 1) will return an empty string, and passing the empty string to Replace is what is causing the error. So (and please excuse any invalid VB.Net) If Row.Area.Contains(“-“) Then Dim area As String = Row.Area.Substring(0, Row.Area.IndexOf(“-“) + 1) Row.Area = Row.Area.Replace(area, … Read more

[Solved] Can I use an Expression to set a variable in a “SQL Statement Task”?

If you are talking about the “Execute SQL Task”, expressions are possible. Here what I usually do is to configure the type as “direct input” and then define the whole statement – including my parametrized values – as expression. If you rightclick the task, you can select properties and in the properties you open the … Read more

[Solved] How to add parameters and conn managers in Power shell script for SSIS

The root issue is the semicolon you are passing in for User::ProcessData is being interpreted as a delimiter for command line parameters and not as value inside a string. You can verify this behaviour by adding a semi-colon to the first property dtexec /ISServer “\SSISDB\DEV\PopulateData\PopulateData.dtsx” /server abbaa.com,3181 /Par “$ServerOption::SYNCHRONIZED(Boolean)”;True /SET \Package.Variables[User::Environment].Properties[Value];”[sql1811174];Dev” That will generate Argument … Read more