title: SQL Return to front end
body: <p>I have the following SQL Server stored procedure and when this is called by the front end code it returns the return value which is 0 instead of select of  total count. can any one tell me what changes do i need to do to make it return the select values instead of return value </p>
  
  <pre><code>SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  
  ALTER procedure [dbo].[getTotalSent1] 
  (
     @vendorworksationID uniqueidentifier  ,
     @sdate date,
     @edate date
  )
  as 
  begin
     select  
         camp.totalSent + bcamp.totalSent as totalSent 
     from 
         (select   
             COUNT(*) as totalSent  
          from 
             AdvertisedCampaignHistory a  
          where 
             CAST(a.CreationDate AS DATE) BETWEEN CAST(@sdate as DATE) AND CAST(@edate as DATE)   
             and a.CampaignID in (select cc.CampaignID 
                                  from campaign cc, VendorWorkStation vw 
                                  where cc.VendorWorkStationID = vw.VendorWorkStationID 
                                    and VendorID = @vendorworksationID))  as camp
     join 
         (select   
              COUNT(*) as totalSent  
          from  
              AdvertisedCampaignHistory a  
          where 
              CAST(a.CreationDate AS DATE) BETWEEN CAST(@sdate as DATE) AND CAST(@edate as DATE)
              and a.CampaignID in (select bc.BCampaignID 
                                   from BeaconCampaign bc, VendorWorkStation vw 
                                   where bc.VendorWorkStationID = vw.VendorWorkStationID 
                                     and VendorID = @vendorworksationID)) as bcamp on 1=1
    end
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Totalsent
  ---------
  240
  
  return 
  -----
  0 
  </code></pre>
  
  <p>It's returning 0, I want total sent value</p>