title: Insert Into temp table and Then Update
body: <p>I use a temp table to insert data that will be later on updated.</p>
  
  <p>For example:</p>
  
  <pre><code>SELECT 
      Name, 
      Address, 
      '' as LaterTobeUpdateField
  INTO #MyTempTable
  FROM OriginalTable
  </code></pre>
  
  <p>Then I update the temp table</p>
  
  <pre><code>UPDATE #MyTempTable
  SET LaterTobeUpdateField = 'new text'
  </code></pre>
  
  <p>Since the original value of LaterTobeUpdateField was '', during the update I will get the following error:</p>
  
  <blockquote>
    <p>String or binary data would be truncated.</p>
  </blockquote>
  
  <p>Is there a workaround other than declaring the temp table before is being used?</p>
  
  <p>This also works, but its ugly</p>
  
  <pre><code>SELECT
      Name, 
      Address, 
      '             ' as LaterTobeUpdateField
  INTO #MyTempTable
  FROM OriginalTable
  </code></pre>