Skip to content

Instantly share code, notes, and snippets.

@tdmitch
Created December 15, 2016 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdmitch/e69e399af29dc25ecb64d5a0b2bd4015 to your computer and use it in GitHub Desktop.
Save tdmitch/e69e399af29dc25ecb64d5a0b2bd4015 to your computer and use it in GitHub Desktop.
// Store the SSIS variables in local C# variables
string exeName = Dts.Variables["$Package::pPathTo7zip"].Value.ToString();
string src = Dts.Variables["$Package::pSource"].Value.ToString();
string dst = Dts.Variables["$Package::pDest"].Value.ToString();
// Create args string
string args = " -y"; // Answer Y to any prompt
args += " a"; // Create archive
args += " " + "\"" + dst + "\" \"" + src + "\""; // Source and dest
// Variable to capture exception message if any
string exceptionTxt = "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment