I am trying to filter items with a stored procedure using like. The column is a varchar(15). The items I am trying to filter have square brackets in the name.
For example: WC[R]S123456
.
If I do a LIKE 'WC[R]S123456'
it will not return anything.
I found some information on using the ESCAPE
keyword with LIKE
but I do not understand how to use it to treat the square brackets as a regular string.
LIKE 'WC[[]R]S123456'
or
LIKE 'WC\[R]S123456' ESCAPE '\'
Should work.