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. One of them asked how to search records with single quotes in a table.

How do I search records with single quotes in it?

SQL Server Product Model list.

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 query with WHERE clause.

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

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.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

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.