title: TSQL - Same query, dfferent result
body: <p>I have a view that unions a single row of hardcoded values (zero's and blanks) with the results of a query. The view definition contains a select statement along the lines of the below. </p>
  
  <pre><code>    SELECT 
        '0' AS Col1,
        ''  AS Col2,
        ''  AS Col3,
        '0' AS Col4
      UNION
      SELECT
        Val1 AS Col1,
        Val2 AS Col2,
        Val3 AS Col3,
        Val4 AS Col4
      FROM MyTable
  </code></pre>
  
  <p>When I execute the statement interactively I get the following result</p>
  
  <pre><code>    Col1    Col2     Col3     Col4
      ------------------------------
      0      'blank'  'blank'   0
      Val1    Val2     Val3     Val4
  </code></pre>
  
  <p>However when I select from the view I get     </p>
  
  <pre><code>    Col1    Col2    Col3     Col4
      ------------------------------
      0       0      'blank'   0
      Val1    Val2    Val3     Val4 
  </code></pre>
  
  <p>Why would the hardcoded blank value for Col2 start returning a zero? </p>
  
  <p>If I create a new view using the same definition I get the expected result (i.e. the same result I get when running interactively) with a 'blank' for Col2. </p>
  
  <p>It only appears to be the hardcoded values that are affected.</p>