I have two rows in dbo.Members but my stored proc is not returning a count. I can run the query alone like SELECT COUNT(*) FROM dbo.Members WHERE MemberID = 1234 and it returns the count as 2 which is correct.
Why does it not return the rows in my stored proc?
SELECT
ValidCount,
InvalidCount,
(SELECT COUNT(*) FROM dbo.Members WHERE MemberID = @pMemberID) AS 'TotalMembers'
FROM
dbo.Reporting
WHERE
MemberID = @pMemberID
Probably because you don’t have entries in
ReportingwithMemberId = 1234.Try this: