SQL Server 2008 R2 Suppressing Stored Proc Result Sets

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.
LVL 17
andrewssd3Asked:
Who is Participating?
 
Brian CroweConnect With a Mentor Database AdministratorCommented:
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
 
andrewssd3Author Commented:
I will try that - I won't be back in the office until Tuesday, but I'll report back then.

Thanks
0
 
andrewssd3Author Commented:
Yes - that's exactly it thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.