Solved

SQL supress result set

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
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.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

803 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