Hide resluts pane for queries with no resluts

  • 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.

  • 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

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply