title: How do I prevent SQL Server returning 3 sets of results?
body: <p>I have a Stored Procedure that calls on 2 other stored procedures to obtain some values.</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[Delivery_SelectByJobID] 
  (
      @job_ID int
  )
  as
  -- if possible - if count(pods) &gt; 0 return true
  -- and           if count(photos) &gt; 0 return true
  declare @podCount int = 0;
  declare @photoCount int = 0;
  
  EXEC @podCount=countPodsForJob @job_ID
  EXEC @photoCount =countPhotosForJob @job_ID
  
  declare @podsBit bit=0
  declare @photosBit bit=0
  
  if @podCount &gt; 0
      begin
  set @podsBit = 1
      end
  
  if @photoCount &gt; 0
      begin
      set @photosBit = 1
      end
  
  SELECT     Job_Reference_No, Job_Start_Date, Job_POD_Filename, Job_Photo_Filename, 
  Job_Signed_For_Name, Job_ID, Job_Status, Job_Delivery_Notes, @podsBit as Job_POD_Supplied, 
                        @photosBit as Job_Photo_Supplied
  FROM         Jobs
  WHERE     (Job_ID = @Job_ID) AND (Job_Status &lt;&gt; 7)
  </code></pre>
  
  <p>When I run this it returns 3 sets of results, i.e. Count_pods, Count_Photos, and the results of the select.
  I only want to return the results of the select.
  How can I stop the other results being returned?</p>