title: SSIS Object Variable In Script Task
body: <p>So I've assigned the result of an "Execute SQL Task" to an object variable in SSIS. I used an object variable instead of a string as only one result is stored and that result is much larger than the 8000 character limit. I'd like to access this information in a script task.</p>
  
  <p>I've set the object variable as a read only variable in the script task and can set it to an object variable in the script task itself, but I can't seem to access the value.</p>
  
  <p>Here's what I want:</p>
  
  <pre><code>Execute SQL Task -&gt; object variable
  Object variable -&gt; script task
  Within Script task{
      String Result = (string)Dts.Variables["User::String"].Value.ToString();
  </code></pre>
  
  <p>I've tried using that exact syntax and that seems to return the type of the variable instead of the value. I've also tried using datasets, but that did not seem to work. What is the best way to access the value in that variable?</p>