SQL SERVER – Search Records with Single Quotes

Every day when I woke up there are hundreds of emails with various questions related to SQL. I spend my first hour of the day answer each of them.

How do I search records with single quotes in it?

SQL SERVER - Search Records with Single Quotes singlequotes1

Here is the answer to find records with single quotes in the table.

SELECT [ProductModelID]
,[Name]
FROM [AdventureWorks2014].[Production].[ProductModel]
WHERE [Name] LIKE '%''%'
GO

SQL SERVER - Search Records with Single Quotes singlequotes2

Do let me know if there is any other way to find records with single quotes in it.

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Scripts
Previous Post
SQL SERVER – Combined Multiple .SQL files into One Single File
Next Post
SQL SERVER – Search Records with Single Quotes – Part 2

Related Posts

12 Comments. Leave new

Leave a Reply