I have checked, and yes - this appears to be the case even for simple
cases.
I would guess that this is because the metadata for temp-tables is *in
the general case* too weak (since the table could be external to the
SP, or could have multiple create points [either of which would also
cause constant SP recompiles]).
If your data-volumes aren't immense, and you don't use an index on the
temp-table, then perhaps consider using a table-variable instead [
DECLARE @varname TABLE (...) ]; the metadata is much stronger and it
works as expected.
If table-variables aren't an option, then you can also edit the dbml
directly: right-click; Open With...; XML Editor; locate your SP and
replace e.g.
<Return Type="System.Int32" />
with
<ElementType Name="StoredProcedure2Result"><!-- bad name ;-p -->
<Column Name="ID" Type="System.Int32" DbType="Int NOT NULL"
CanBeNull="false" />
<Column Name="Value" Type="System.Int32" DbType="Int NOT NULL"
CanBeNull="false" />
</ElementType>
and rebuild.
Note that there is also a LINQ-specific forum that you may find
useful:
http://forums.microsoft.com/MSDN/Sho...D=123&SiteID=1
Marc