title: EF 6 database first: How to update stored procedures?
body: <p>We are using <a href="http://entityframework.codeplex.com/wikipage?title=specs" rel="noreferrer">Entity Framework 6.0.0</a> and use database first <a href="http://msdn.microsoft.com/en-us/data/jj206878.aspx" rel="noreferrer">(like this)</a> to generate code from tables and stored procedures.  This seems to work great, except that changes in stored procedures are not reflected when updating or refreshing the model.  Adding a column to a table is reflected, but not adding a field to a stored procedure.  </p>
  
  <p>It is interesting that if I go to the <code>Model Browser</code>, right click the stored procedure, select <code>Add Function Import</code> and click the button <code>Get Column Information</code> we can see the correct columns.  This means that the model <em>knows</em> of the columns, but does not manage to update the generated code.</p>
  
  <p>There is one workaround, and that is to delete the generated stored procedure before updating the model.  This works as long as you have not made any edits on the stored procedure.  Does anyone know of a way to avoid this workaround?</p>
  
  <p>I am using <code>Visual Studio 2013</code> with all the latest updates as of early December 2013.</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Update 1:</strong>
  andersr's answer helped in one case, where the stored procedure used a temporary table, so i gave him +1, but it still does not solve the main problem of updating simple stored procedures.</p>
  
  <p><strong>Update 2:</strong>
  shimron's comment below links to a question about the same issues in EF 3.5.  It seems the same is still true for EF 6.0.  Read it for an alternative way of doing it, but my conclusion as of now is that the simplest way of doing it is to delete the generated stored procedure before updating the model.  Use partial classes if you want to do something fancy.</p>