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

后端 未结 15 2136
小鲜肉
小鲜肉 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:44

    I also had the problem (VS 2012, SQL Server 2008R2). In my case it was a combination of the + operator and various CAST statements in the code. I haven't found a way to replace them with something VisualStudio likes, but I have come up with a workaround:

    Workaround "Dummy SELECT":

    • Create a dummy SELECT statement with all the fields you need to return. For example:
        select 'bla bla' as field1, 123123 as field2, 'asñfs' as field3
    
    • Comment out your SP code and just leave the dummy SELECT in your SP.
    • Add your SP in the O/R designer and save (it should do know without an error message)
    • Restore your original SP (leave the dummy SELECT as a comment for future use)

提交回复
热议问题