I have a stored procedure with a parameter @name nvarchar(50). Now the stored procedure itself looks like this:
CREATE PROCEDURE [dbo].[dcspFilterEmpList]
@empName nvarchar
AS
SELECT
employee_id AS 'ID',
name_1+' '+surname AS 'NAME'
FROM
Employees
WHERE
'NAME' LIKE '%'+@empName+'%'
I enter any part of a name that exists in the table, but, as a result, I get the whole table. Sometimes I get strange results, e.g. two rows, one of which matches criteria, the other one doesn't.