首页  >  文章  >  数据库  >  A rowset based on the SQL command was not returned by the OL

A rowset based on the SQL command was not returned by the OL

WBOY
WBOY原创
2016-06-07 15:44:161099浏览

今天使用 SSIS OLEDB Source 调用存储过程出现下面的错误: A rowset based on the SQL command was not returned by the OLE DBprovider 解决办法: 在存储过程中使用 set nocount on ; 原因: 因为执行存储过程中返回影响行数信息先于真实的数据返回,而 S

今天使用SSIS OLEDB Source 调用存储过程出现下面的错误:

 

A rowset based on the SQL command was not returned by the OLE DBprovider

 

解决办法:

 

在存储过程中使用 setnocount on ;

 

原因:

 

因为执行存储过程中返回影响行数信息先于真实的数据返回,而SSIS尝试读取这个结果集,导致出现错误。使用set nocount on之后阻止在结果集中返回可显示受 Transact-SQL语句或存储过程影响的行计数的消息从而只返回真正的结果集。

 

 

 

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn