Unanswered: NEED Query to find apostrophes in table
I've tried everything I can think of to find all the records in a table column (lastname) that contain an apostrophe. I know they are there (O'Brian, D'Marcus, etc.) However, I keep getting syntax errors.
SET NOCOUNT ON
CREATE TABLE myTable99(Col1 varchar(80))
CREATE INDEX IX1 ON myTable99(Col1)
INSERT INTO myTable99(Col1)
SELECT 'abc' UNION ALL
SELECT 'a''c' UNION ALL
WHERE LEN(Col1) <> LEN(REPLACE(Col1,CHAR(39),''))
WHERE Col1 LIKE '%''%'
SET NOCOUNT OFF
DROP TABLE myTable99
....it's a scan. I wonder if one would be more effecient than the other though