[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

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.
0
andrewssd3
Asked:
andrewssd3
  • 2
1 Solution
 
Brian CroweCommented:
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

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now