title: SSIS Package validation errors due to expected empty variable
body: <p>I have a number of SSIS packages which I have deployed to SQL Server 2014. The packages take a file parameter which I place into a variable. From that rawFile variable a number of variables are derived. The packages are running fine in my development environment and are providing me with the output I am expecting. The problem I have is that I am unable to deploy the .dtsx packages using SSMS because of the following (I think expected because there is no filename yet) errors:</p>
  
  <p>Error loading XXXXXXX.dtsx: Casting expression "SUBSTRING(@[User::varRawFile],19,2)" from data type "DT_WSTR" to data type "DT_I4" failed with error code 0xC00470C2.</p>
  
  <p>Error loading XXXXXXX.dtsx: Error code 0x80020005 occurred attempting to convert from data type DT_WSTR to data type DT_I4. </p>
  
  <p>Error saving XXXXXXX.dtsx: The expression for variable "varDataMonth" failed evaluation. There was an error in the expression.</p>
  
  <p>In design mode I have DelayValidation and ValidateExternalMetadata set True and False for all objects respectively. I am able to work around the issue by deploying directly from Visual Studio but this isn't inline with my organisation's change management process.</p>
  
  <p>Any help much appreciated.</p>