If you are trying to check for strict equality, do the following:
AND
(
CS.StudentName = @StudentName
OR NULLIF(@StudentName,'') IS NULL
)
AND
(
Cl.Street = @StreetAddress
OR NULLIF(@StreetAddress,'') IS NULL
)
If you are trying to do a LIKE condition, then this:
AND
(
CS.StudentName LIKE '%'+@StudentName+'%'
OR NULLIF(@StudentName,'') IS NULL
)
AND
(
Cl.Street LIKE '%'+@StreetAddress+'%'
OR NULLIF(@StreetAddress,'') IS NULL
)
I have to caution you though, that this type of "catch-all" queries tend to perform poorly. Take a look at this blog.