While drag-drop a stored procedure in dbml file I get this error:
Unknown Return Type
The return types for the following stored
I was using a temp table in my SQL and was getting this error. I converted the temp table to table variables and that resolved my issue.
Add these lines right after parameters declaration
AS
IF 1=0 BEGIN
SET FMTONLY OFF
END
After this, write BEGIN and start your procedure work .
Just in case anyone else comes across this, I have just experienced it myself.
In my case, I was referencing a table in an insert statement that no longer existed in my schema. A closer inspection of my code revealed I was inserting into a table called "Account" which was now called "tblAccount". Visual Studio threw no errors on saving the sp, but I experienced the same error when trying to add the sp to the dbml file.
Hopefully this will help someone else out.
A simple way to solve this issue is (December 2019)
Hope I can help.
This problem occurs whenever the designer cannot figure out the return type of the SP.
Same problem and solutions described here
How to get multiple result set of procedure using LINQ to SQL
This can be also the problem of access rights. If the stored procedure doesn't have an access to the table you get the same error. I had a query selecting data from another database I didn't have rights for (in fact the account running the Visual Studio connection didn't have the rights) and I received the same error. After adding proper rights everything went fine.
Trying to execute the stored procedure inside VS2010 (by right clicking in Server Explorer and selecting "Execute") helped me to solve the problem.