BookId & StudentId has int DataType. Parameters value '0','20,21,22'
ALTER PROC [dbo].[USP_SessionBookPlanningSearch] --'0','20,21,22' ( @BookID VARCHAR(500), @StudentID VARCHAR(500) ) AS BEGIN
with ROWCTE as ( SELECT * from View_Session Where (('''+@@BookId+'''=''0'' OR BookID IN('+ cast(@@BookId as varchar(Max))+')) and (('''+@@@StudentID+'''=''0'' OR StudentID IN('+ cast(@@@StudentID as varchar(Max))+'))
)
SELECT * FROM ROWCTE
end