Skip to content
Advertisement

Incorrect syntax near ‘<' in SQL Server Scalar Functions

Here is the requirement:

Find all teachers whose FirstName length is less than 5 and the first 3 characters of their FirstName and LastName are the same

I tried this query (Scalar Function):

To call function:

But, when I execute first query, it shows error:

Incorrect syntax near ‘<‘.

Can anyone help me with this?

Advertisement

Answer

Just use a normal query, not a function. Also there is no boolean type in SQL Server, use bit instead.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement