I want to search and select columns where there is a single quote (') present in the text using LIKE or CONTAINS Predicate.
consider the following text : 10011-RIO MARE EXTRA'
I want to search and select columns where there is a single quote (') present in the text using LIKE or CONTAINS Predicate.
consider the following text : 10011-RIO MARE EXTRA'
CREATE TABLE #TEST
( Test_Column VARCHAR(MAX));
INSERT INTO #TEST VALUES
('10011-RIO MARE EXTRA''')
SELECT *
FROM #TEST
WHERE Test_Column LIKE '%''%'
The escape character for ' is ' used twice -> ''.
try this
select * from yourtable where youcolumn like '%''%'
Find records with single quotes in the table
SELECT *
FROM [tableName]
where Name like '%''%'
I hope this solves your problem
% ' % -> Finds any values that have " ' " in any position
By executing below query you will get the result which have '(single quote) in them
SELECT * FROM TABLE_NAME WHERE COLUMN_NAME LIKE "%'%"
i have executed the same query enter image description here