title: How to store select statement result to table variable in sql server
body: <pre><code>Declare @T_variable table(name varchar(200))
  SET @T_variable =(SELECT au_lname FROM Testing)
  </code></pre>
  
  <blockquote>
    <p>Error Message. Msg 137, Level 16, State 1, Line 2 Must declare the
    scalar variable "@T_variable".</p>
  </blockquote>
  
  <p>Note :- select statement result will give multiple rows.</p>
  
  <p>I try to capture the select result in table variable.But i failed.
  Is there any way to capture the select result to Table variable Dynamically.</p>
  
  <p>Thanks in advance.</p>