Solved

SQL supress result set

Posted on 2011-02-28
4
402 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
[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
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

695 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