title: How does alter table switch works on sql server?
body: <p>I am using switch table sometime on SQL Server 2008 to transfer quickly data between 2 tables, but I do not know how it works, and what's the difference between this an just a <code>insert into T2 select * from T1</code>.</p>
  
  <p>Someone can explain in detail how it works and the difference?</p>
  
  <p>Furthermore I notice that if both tables are not clones this statement does not work. For example if I have one index in one table and not in the other one it fails.</p>