tsql – 实体框架4:所选存储过程不返回任何列

栏目: 数据库 · SQL Server · 发布时间: 6年前

内容简介:尝试将此行添加到存储过程的开头:设置FMTONLY OFF完成导入后,可以将其删除.

在我的SP中,我混合了静态 SQL 和动态SQL:

declare @result table
(
 RowNum bigint,
 Id_and_Title varchar(max),
 DaysLeft int,
 cat_id int
);

然后,在动态SQL中,我将结果插入到该表中:

DECLARE @TSQL NVARCHAR(max);
SET @TSQL = ......

(我使用print @TSQL所以我确定查询没问题)

insert into @result
EXECUTE sp_executesql @TSQL

select * from @result

但是,当我尝试在VS 2010 Ultimate中导入taht SP时,我会看到标题中提到的消息.是什么导致的?很多次我发生了这个错误,但我仍然不知道是什么原因引起的

尝试将此行添加到存储过程的开头:

设置FMTONLY OFF

完成导入后,可以将其删除.

它在 this article 中提到过(有点长篇大论)并且它对我有用,虽然我最终回到ADO.NET的时候我依赖Stored Procedures.请记住,如果您的列根据动态SQL而更改,您的实体模型将会中断.

翻译自:https://stackoverflow.com/questions/4473998/entity-framework-4-the-selected-stored-procedure-returns-no-columns


以上所述就是小编给大家介绍的《tsql – 实体框架4:所选存储过程不返回任何列》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Distributed Algorithms: An Intuitive Approach

Distributed Algorithms: An Intuitive Approach

Wan Fokkink / MIT Press / 2018-2-2 / USD 48.00

The new edition of a guide to distributed algorithms that emphasizes examples and exercises rather than the intricacies of mathematical models. This book offers students and researchers a guide to ......一起来看看 《Distributed Algorithms: An Intuitive Approach》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具