The return types for the following stored procedures could not be detected

后端 未结 15 2129
小鲜肉
小鲜肉 2020-12-09 08:09

While drag-drop a stored procedure in dbml file I get this error:

Unknown Return Type
The return types for the following stored

相关标签:
15条回答
  • 2020-12-09 08:36

    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.

    0 讨论(0)
  • 2020-12-09 08:37

    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 .

    0 讨论(0)
  • 2020-12-09 08:38

    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.

    0 讨论(0)
  • 2020-12-09 08:39

    A simple way to solve this issue is (December 2019)

    • 1 Just making double # precede #tmp => ##tmp
    • 2 Comment out DROP TABLE #tmp => --DROP TABLE #tmp
    • Execute stored procedure and make sure that data showed up
    • Drag stored procedure again and that's it, It will generate return type
    • Last, Turn your store back to first situation and then save.

    Hope I can help.

    0 讨论(0)
  • 2020-12-09 08:40

    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

    0 讨论(0)
  • 2020-12-09 08:41

    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.

    0 讨论(0)
提交回复
热议问题