title: DDL statements with variables for table and column names
body: <p>In my stored procedure, I make a <code>temp_tbl</code> and want to add several columns in a cursor or while loop. All works fine the cursor (the creation of a <code>temp_bl</code> but I can´t add the column when the column string is in a varchar variable.</p>
  
  <pre><code>WHILE @@FETCH_STATUS = 0
  BEGIN       
  SET @webadressenrow = 'Webadresse_'+CAST(@counter as nchar(10))
  
      ALTER TABLE IVS.tmpBus
          ADD @webadressenrow varchar(500) Null
  
      fetch next from cur_web into @webadressen
      SET @counter = @counter + 1
  END
  </code></pre>
  
  <p>The code above results in a syntax error, while this code works:</p>
  
  <pre><code>WHILE @@FETCH_STATUS = 0
  BEGIN       
  SET @webadressenrow = 'Webadresse_'+CAST(@counter as nchar(10))
  
      ALTER TABLE IVS.tmpBus
       ADD SOMECOLUMNAME varchar(500) Null
  
      fetch next from cur_web into @webadressen
      SET @counter = @counter + 1
  END
  </code></pre>
  
  <p>Can anybody give me a syntax hint to this small problem? </p>