Error: Unknown Return Type, The return types for the following stored procedures could not be detected…..
The return types for the following stored procedures could not be detected. Set the return type for each stored procedure in the Properties window.
This error usually comes when you are trying to add your Stored Procedure into DBML (LINQ) file.
This problem occurs whenever the designer cannot figure out the return type of the SP. This usually happens when the stored procedure has multiple results or uses a temp table. The SQL Server feature that attempts to derive the Meta data of the function reports no columns for the result shape, so the designer defaults to thinking it only has the single int return value.
· The one way to get these types of stored procedures to work is to edit DBML by hand or write your own method signature for the procedure in a partial class To Handle multiple record set return from stored procedure by LINQ see the link here.
· The second way is to avoid using #temp Table in your stored procedure, instead of you can use Table type variable like below (@TempTable)
DECLARE @TempTable TABLE
INSERT INTO @TempTable Select * from Attribute
--Execute SP and insert results into @TempTable
INSERT INTO @TempTable Exec GetAttribute @Id
You can do all operation which you was doing with #Temp table like Join, Insert, Select etc.