You've stored the data in a manner that's an anti-pattern. For example, you can't simply index your search. If normalised, however, you Can EASILY index the search.
For example...
CREATE TABLE [dbo].[person_list]
(
id INT IDENTITY(1,1),
list NVARCHAR(100)
);
INSERT INTO
[dbo].[person_list] (list)
VALUES
(N'Ken, Brian, Mike,')
(N'Mikem, Briane, Kenny,')
;
CREATE TABLE [dbo].[person]
(
id INT IDENTITY(1,1),
person NVARCHAR(100),
person_list_id INT
);
INSERT INTO
[dbo].[person] (person, person_list_id)
VALUES
(N'Ken', 1),
(N'Brian', 1),
(N'Mike', 1),
(N'Mikem', 2),
(N'Briane', 2),
(N'Kenny', 2)
;
SELECT
*
FROM
person_list
INNER JOIN
person
ON person.person_list_id = person_list.id
WHERE
person.person = N'Mike'
If you MUST stick with your broken structure, you CAN do this...
SELECT
*
FROM
person_table
WHERE
N', ' + person LIKE N'%, Mike, %'
-- Assumes the person column is ALWAYS terminated with ', ' as per your example
Which will perform like shit on larger tables, be a maintenence headache, and break if you ever get names like Mike, Jr
EDIT:
Or, tidying up a string_split()
example (but having the exact same problems as the LIKE
version...)
SELECT
*
FROM
person_table
CROSS APPLY
string_split(replace(person_table.person, N', ', N',') N',') AS person
WHERE
person.value = N'Mike'