title: Recommend usage of temp table or table variable in Entity Framework 4. Update Performance Entity framework
body: <p>I need to update a bit field in a table and set this field to true for a specific list of Ids in that table.</p>
  
  <p>The Ids are passed in from an external process.</p>
  
  <p>I guess in pure SQL the most efficient way would be to create a temp table and populate it with the Ids, then join the main table with this and set the bit field accordingly.</p>
  
  <p>I could create a SPROC to take the Ids but there could be 200 - 300,000 rows involved that need this flag set so its probably not the most efficient way. Using the IN statement has limitation wrt the amount of data that can be passed and performance.</p>
  
  <p>How can I achieve the above using the Entity Framework</p>
  
  <p>I guess its possible to create a SPROC to create a temp table but this would not exist from the models perspective.</p>
  
  <p>Is there a way to dynamically add entities at run time. [Or is this approach just going to cause headaches].</p>
  
  <p>I'm making the assumption above though that populating a temp table with 300,000  rows and doing a join would be quicker than calling a SPROC 300,000 times :)
  [The Ids are Guids]</p>
  
  <p>Is there another approach that I should consider.</p>