Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL Server 2008 R2 Suppressing Stored Proc Result Sets

Posted on 2013-05-24
3
Medium Priority
?
490 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
Brian Crowe earned 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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.
Suggested Courses

636 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