While drag-drop a stored procedure in dbml file I get this error:
Unknown Return Type
The return types for the following stored
Just ran into this issue while trying to add a stored procedure into a DBML (LINQ) file.
Doing some research I found that this usually happens when the stored procedure returns multiple results or uses a #temp table for it's final select.
The solution that worked for me was to create a new stored procedure that wrapped the results of the original stored procedure result, into a table variable with the same columns as the temp table.
My wrapper stored proc looked something like this:
DECLARE @NewPrograms TABLE (
Campaign_Number int,
Campaign_Display nvarchar(255)
)
INSERT INTO @NewPrograms
EXEC [dbo].[Original_Stored_Proc_With_Temp_Table_Result] @Program_ID
Select *
From @NewPrograms
Open up your DBML file, drag-and-drop in your new wrapper stored proc.