SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Hide resluts pane for queries with no resluts


Hide resluts pane for queries with no resluts

Author
Message
tltedder
tltedder
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 15
I have a query that I will eventually make into a stored procedure.
It is sort of a QA helper that our team members can run to help identify possible data issues.
The issue that I am running into is that not all of the sub queries are applicable to all users.
Is there a way to hide the results pane for the sub queries that have no results?
This will only show the queries that have things that they need to address and will help to clean up the results pane.
J.Faehrmann
J.Faehrmann
Mr or Mrs. 500
Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)Mr or Mrs. 500 (538 reputation)

Group: General Forum Members
Points: 538 Visits: 1442
Use temporary tables to store the results and check if they return something before selecting from them

SELECT 1 Test INTO #t1
SELECT 2 Test INTO #t2
DELETE #t2 --now #t2 is empty
SELECT 3 Test INTO #t3

IF EXISTS(SELECT 1 FROM #t1)
SELECT * FROM #t1

IF EXISTS(SELECT 1 FROM #t2)
SELECT * FROM #t2

IF EXISTS(SELECT 1 FROM #t3)
SELECT * FROM #t3


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search