Solved

SQL Server 2008 R2 Suppressing Stored Proc Result Sets

Posted on 2013-05-24
3
475 Views
Last Modified: 2013-05-28
I have a stored proc which returns multiple result sets.  The results are consumed by a VBA client using ADODB to cycle through the result sets using the NextRecordSet method.

Among the genuine result sets it returns from SELECT statements, there is another result set from an INSERT INTO which the ADODB code skips past, as it's not openable as a RecordSet and does not contain anything useful anyway. I have had to add another INSERT INTO, which means changing all the code that uses this to skip another useless RecordSet.

Can anyone tell me if there's a way to suppress these result sets from INSERTs and UPDATEs? I have done quite a bit of googling but can't find anything about this.

I don't particularly like the way the SP works, but changing the fundamentals is not really an option as a lot of code depends on the current output.
0
Comment
Question by:andrewssd3
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Brian Crowe earned 500 total points
ID: 39194969
do you see SET NOCOUNT ON in your stored procedure?  If not try adding that at the top.  It may be returning the rows affected value for your INSERT/UPDATE.
0
 
LVL 17

Author Comment

by:andrewssd3
ID: 39195634
I will try that - I won't be back in the office until Tuesday, but I'll report back then.

Thanks
0
 
LVL 17

Author Closing Comment

by:andrewssd3
ID: 39200568
Yes - that's exactly it thanks
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

774 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question