title: Problem with Entity Framework 4, Complex Types, StoredProcs, and temp tables
body: <p>I am skinning my knees on Entity Framework 4 and running into a slight problem.  </p>
  
  <p>I have some stored procedures that I am pulling into my EDMX.  When I create complex types from these procs, EF has no problem getting the column information.  Except in one place.  After being puzzled for a while, I figure out it was my temporary table getting populated that is causing the problem.  Actually it is simply calling the INSERT into the temp table that is causing the problem.  I'm not actually populating it with any information.</p>
  
  <p>While I know that I can manually create a complex type then map the function to that type, I would like to be able to just let EF take care of it for me.  Does anyone know what I am doing wrong?</p>
  
  <p>Below is a sample proc that doesn't work.  Run this in a DB and add the proc to you EDMX.  Then try to get the column information in the "Add Function Import" screen.  Nothing is returned.  Comment out the INSERT to the temp table and get the column information and it works. </p>
  
  <p>Thanks,
  Steve</p>
  
  <pre><code>CREATE PROCEDURE dbo.TestProc
  AS
  
  SET NOCOUNT ON  
  
      CREATE TABLE #TempTable(
          StartDate datetime
      )
  
      INSERT INTO #TempTable
      SELECT  null
  
  
      DROP TABLE #TempTable
  
      SELECT 1 AS ReturnValue
  
  SET NOCOUNT OFF
  GO
  </code></pre>