title: Truncate/Clear table variable in SQL Server 2008
body: <p>Is it possible to truncate or flush out a table variable in SQL Server 2008?</p>
  <pre><code>declare @tableVariable table
  (
     id int, 
     value varchar(20)
  )    
  
  while @start &lt;= @stop    
  begin    
      insert into @tableVariable(id, value) 
          select id
              , value 
          from xTable 
          where id = @start
      
      --Use @tableVariable 
  
      --@tableVariable should be flushed out of 
      -- old values before inserting new  values
  
      set @start = @start + 1 
  end 
  </code></pre>