title: Difference between CTE, Temp Table and Table Variable in MSSQL
body: <p>All are used to store data temporarily. </p>
  
  <p>Are there any performance difference (<strong>time complexity and space complexity</strong>) for these 3 types of temporary table? </p>
  
  <p>Performance issue should depend on whether the result is saved on disk or memory.</p>
  
  <p>I have searched a lot but did not get satisfactory answer. </p>