title: Passing dtexec SSIS package params to SQL execution task(s)
body: <p>so I'm pretty new to SSIS here. I have some fields that I'd really like to set globally for my package rather than continuing to finagle with dozens of SSIS tasks. I'm doing this programatically and learned that you can set these calling the package like this:  </p>
  
  <pre><code>SET @ExecuteStatement=
      'C:\Program Files\Microsoft SQL Server\120\DTS\Binn\DTExec /f "\\' + @DBInstance + '\SSIS\Universal.dtsx" 
          /set \Package.Variables[User::Email].Properties[Value]; "' + @Email + '" 
          /set \Package.Variables[User::SSASServer].Properties[Value]; "' + @SSASServer + '"
          /set \Package.Variables[User::MSSQLServer].Properties[Value]; "' + @MSSQLServer + '"
          /set \Package.Variables[User::SSASDatabaseName].Properties[Value]; "' + @SSASDatabaseName + '" 
          /set \Package.Variables[User::LinkedServerAlias].Properties[Value]; "' + @LinkedServerAlias + '" 
          /set \Package.Variables[User::ThreadCount].Properties[Value]; ' + CAST(@ThreadCount AS VARCHAR);
  
  
  INSERT INTO @LOG
      EXEC @returncode = xp_cmdshell @ExecuteStatement
  </code></pre>
  
  <p>My understanding is that this will set the scope of those User:: variables at the package level. I have dozens of SQL execution tasks that similarly call SQL scripts that I would really like to pass these params around to. Apparently these SSIS variables get set at run-time, so any sproc that references @[User::Email]  ends up being undefined. </p>
  
  <p>How can I can make sure tasks (execute SQL and mail) have access to these variables so that each package stands alone when being run by users? I'm trying to avoid globals that can be overwritten here so that several people can run it and configure the fields as needed. </p>
  
  <p>Thanks in advance!</p>