spGetNewSurveyResponsesCount

Definition

Copy

                CREATE  procedure [dbo].[spGetNewSurveyResponsesCount]
                as
                begin
                set nocount on
                declare @delTrans         integer
                declare @newResponses    integer

                select @newResponses = count(*)
                from dbo.siteSurveyResponses sr
                inner join dbo.sitesurveys ss on ss.id = sr.sitesurveysid
                where dbo.fnGetRecordIDFromLinkedUserID(sr.clientusersid,0) > 0
                and REProcessed = 0
                and exists (select * from dbo.SiteSurveyResults ssr where ssr.SiteSurveyResponsesId = sr.id )

                select @deltrans = count(*)
                from dbo.SiteSurveyResponsesDeleteTransactions

                select (@deltrans + @newResponses)
                end