title: select statement in a variable I need to out put to a temp table
body: <p>I am sure this is easy but I have a select statement stored as a variable e.g. @statement contains a statement "select count(*) from table1" I need to execute this variable e.g. sp_executesql @statement   but put the results in to a temp table, is this possible easily?</p>
  
  <p>Thanks </p>