title: How do I CREATE TABLE with dynamic column names (saved in variables)?
body: <p>I want to create a table with column names like <code>Members_2014</code> and <code>Spend_2014</code>. I've tried to have the year setup as a variable and concatenate <code>Member_ + @year</code>, so that the <code>@year</code> will decrease, but the code I've written doesn't seem to work:</p>
  
  <pre><code>declare @li_year    int
  declare @li_year2   int
  declare @li_year3   int
  declare @li_year4   int
  declare @li_year5   int
  
  set @li_year = datepart(year, GETDATE())
  set @li_year2 = @li_year-1
  set @li_year3 = @li_year-2
  set @li_year4 = @li_year-3
  set @li_year5 = @li_year-4
  
  drop table [scratchdb].[dbo].results_test
  create table [scratchdb].[dbo].results_test (RDesc varchar(30), 
     'Members_' + @li_year int, 
     'Spend_' + @li_year money,
     'Members_' + @li_year2  int, 
     'Spend_' + @li_year2 money,
     'Members_' + @li_year3  int, 
     'Spend_' + @li_year3 money,
     'Members_' + @li_year4  int, 
     'Spend_' + @li_year4 money,
     'Members_' + @li_year5 int, 
     'Spend_' + @li_year5 money)
  </code></pre>