title: SSIS The expression for variable 'Variable' failed evaluation. There was an error in the expression
body: <p>So here we have an error I keep getting in my SSIS package but I can't see what is wrong with the statement. I have even tried another sql statement from a project that works and it still raises the error.</p>
  
  <p>The system is VS 2005 running 64 bit debugger, on XP machine. The project has amongst other things a script task then a sql task, the script task outputs the month value to a variable (Dts.Variables("monthName").Value = month), which I then use to create dynamic table name in SQL statement. I haven't got to the excel sheet bit yet as I am trying to get the sql task stage working.</p>
  
  <p>So i have a variable at package level called SQLTableCreate, and in that I have the properties set to:</p>
  
  <ul>
  <li>Evaluate as Expression = true</li>
  <li>Expression = "Create Table "+ @[user::monthName]+"(<code>Column1</code> DATETIME,<code>Column2</code> NVARCHAR(255),<code>Column3</code> NVARCHAR(255),<code>Column4</code> NVARCHAR(255),<code>Column5</code> NVARCHAR(255),<code>Column6</code> NVARCHAR(255),<code>Column7</code> NVARCHAR(255),<code>Column8</code> NVARCHAR(255),<code>Column9</code> NVARCHAR(255),<code>Column10</code> NVARCHAR(255))"</li>
  </ul>
  
  <p>And when I build the package I get:</p>
  
  <blockquote>
    <p>Nonfatal errors occurred while saving the package:
    Error at Package: The variable "user::monthName" was not found in the Variables collection. The variable might not exist in the correct scope.
    Error at Package: Attempt to parse the expression ""Create Table "+ @[user::MonthName]+"(<code>Column1</code> DATETIME,<code>Column2</code> NVARCHAR(255),<code>Column3</code> NVARCHAR(255),<code>Column4</code> NVARCHAR(255),<code>Column5</code> NVARCHAR(255),<code>Column6</code> NVARCHAR(255),<code>Column7</code> NVARCHAR(255),<code>Column8</code> NVARCHAR(255),<code>Column9</code> NVARCHAR(255),<code>Column10</code> NVARCHAR(255))"
    " failed and returned error code 0xC00470A6. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error.Error at Package: The expression for variable "SQLTableCreate" failed evaluation. There was an error in the expression.</p>
  </blockquote>
  
  <p>There is also a default SQL statement for the variable SQLTableCreate, which uses the current excel connection manager table name. When I put my dynamic statement in the expression section of properties it fills the value and valuetype property of the SQLTableCreate variable with the message:</p>
  
  <blockquote>
    <p>The expression for variable "SQLTableCreate" failed evaluation. There was an error in the expression.</p>
  </blockquote>