Solved

SQL supress result set

Posted on 2011-02-28
4
393 Views
Last Modified: 2012-05-11
I have a stored proc that calls other store procs which call other stored procs... When I call MY stored proc I want to supress the result set of the stored procs I'm calling... For example.. say my proc is called 'one'.. Stored proc 'one' calls stored proc 'two" and stored proc "two" calls stored proc"three"... I do not want to see the results of stored proc three.. I just want to run it becuase it does some things but it also has select statements in it and I dont want to see the select statements from "three".. My DBA wants me to do this in "one" NOT and I repeat.. He does NOT want me to put any code in "three".. Is there a way to supress the result of "three" from my stored proc "one"???
0
Comment
Question by:cheryl9063
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 34997206
no, that is not possible.

the only thing you can do is supress empty recordsets.


0
 
LVL 15

Expert Comment

by:derekkromm
ID: 34997213
Short answer: No

If "three" has select statements that return datasets, there is no way to suppress those

I'd suggest to your DBA that, in order to reduce duplicity of code, you simply add an optional bit parameter called "HideResults" that defaults to 0 and wrap around each select statement "if @HideResults = 0 ..."
0
 
LVL 10

Accepted Solution

by:
dwe761 earned 500 total points
ID: 34997216
Create a stored proc Three_A which calls Three.

Three_A could have a parameter that says whether or not you want to suppress results.  If suppress then don't return them from Three_A, if not, then return results from Three_A.
0
 
LVL 1

Author Closing Comment

by:cheryl9063
ID: 35084931
That is actually quite clever.. Thanks!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now