I have a stored procedure where I will use @variable in
WHERE colname LIKE(@variable)
This @variable could be a string list representing column names, such as
EXEC usp_cols 'col1, col2, col3';
I want to split this string to list of strings in the stored procedure, so that it converts to 'col1', 'col2', 'col3' in the stored procedure to use it in the LIKE statement:
WHERE colname LIKE('col1', 'col2', 'col3')
STRING_SPLIT.