I would like to retrieve total rows and also all values through a stored procedure in SQL Server. I have something like below. However, it mentioned of it is not contained in either an aggregate function or the GROUP BY clause. Appreciate for any reply. Thanks.
ALTER PROCEDURE abc.testing
@facility varchar(50),
@date datetime
AS
SELECT count(*), *
FROM ss_table
WHERE _start = @date
And fid IN (SELECT id
FROM ss_facilities
WHERE name = @facility)