title: Table variable in SQL Server
body: <p>I am using SQL Server 2005. I have heard that we can use a table variable to use instead of LEFT OUTER JOIN.</p>
  
  <p>What I understand is that, we have to put all the values from the left table to the table variable, first. Then we have to UPDATE the table variable with the right table values. Then select from the table variable.</p>
  
  <p>Has anyone come across this kind of approach? Could you please suggest a real time example (with query)? </p>
  
  <p>I have not written any query for this. My question is - if someone has used a similar approach, I would like to know the scenario and how it is handled. I understand that in some cases it may be slower than the LEFT OUTER JOIN.</p>
  
  <p>Please assume that we are dealing with tables that have less than 5000 records.</p>
  
  <p>Thanks </p>