Solved

SQL supress result set

Posted on 2011-02-28
4
400 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 143

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Copy Database Wizard 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.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 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