Note that there are some explanatory texts on larger screens.

plurals
  1. PODynamic Flat File Source Path
    text
    copied!<p>I'm trying to pass a dynamic file path to a SSIS package variable. I'm setting the ConnectionString value to the variable value in the connection expressions.</p> <p>So to get started I set the initial variable <s>name</s> value to products.csv and get the error:</p> <blockquote> <p>Nonfatal errors occurred while saving the package: The name cannot contain any of the following characters: / \ : [ ] . =</p> </blockquote> <p><img src="https://i.stack.imgur.com/RGgLQ.png" alt="enter image description here"></p> <p>I remove the .csv from the variable name, since I'm passing this value from code anyways - no biggie. But when I pass the appropriate variables and execute the package I get weirdness. I check the db and the expected values from the package are there, but I get a failure status and errors similar to the one I mentioned above.</p> <p>Below is my code:</p> <pre><code>GeneralUtilities.ExecutePackage( new ListDictionary() { {"ClientId", Client.Id}, {"FileName", ConfigurationManager.AppSettings["DownloadLocation"] + @"\" + this.OriginalName} }, "Products.dtsx"); public static void ExecutePackage(ListDictionary variables, string packageName) { string pkgLocation; Package pkg; Application app; DTSExecResult pkgResults; Variables vars; pkgLocation = ConfigurationManager.AppSettings["PackageLocation"] + packageName; app = new Application(); using (pkg = app.LoadPackage(pkgLocation, null)) { vars = pkg.Variables; foreach (DictionaryEntry variable in variables) { vars[variable.Key].Value = variable.Value; } pkgResults = pkg.Execute(null, vars, null, null, null); for(int i=0;i&lt;pkg.Errors.Count;i++) Console.WriteLine(pkg.Errors[i].Description); Console.WriteLine(pkgResults.ToString()); } } </code></pre> <p>And here's the output:</p> <p><img src="https://i.stack.imgur.com/w8fYh.png" alt="enter image description here"></p> <p>It's cool that it's being input into the db, but I don't think the Failure message will work. Seems like a package setting or something that is causing a 'false failure'. Can anyone provide help? Thanks.</p> <p><img src="https://i.stack.imgur.com/0ps8P.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/A77iB.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload