I am trying to create a Sql function,Where a list of students is fetched by specifying their class status.I could create a function to retrieve such an information for a single user,But when i tried to get a list for all of them i get this error. This is my Functions declaration in Sql:
CREATE FUNCTION dbo.Function_GetListOfStudentsWithClassStatus
(
@ClassTypeid int,
@VerificationCode bit
)
RETURNS TABLE/* @table_variable TABLE (column1 datatype, column2 datatype) */
AS
RETURN SELECT *, COUNT(*) AS CLassNumbers
FROM dbo.tblClass2
WHERE (ClassTypeID = @ClassTypeid) AND (Verified = @VerificationCode)
GROUP BY StNID