Search Records with Single Quotes in Sql Server

Sometime we need to find some records those are having single quotes(” ‘ “), below is the query to find out such records:

DECLARE @t TABLE(ItemID int identity(1,1), ItemDescription varchar(100));
INSERT INTO @t(ItemDescription)
VALUES(‘This is men”s shirt’),(‘This is girl”s skirt’),(‘This is short shirt’),(‘This is test item’)

SELECT *
FROM @t t
WHERE t.ItemDescription LIKE ‘%”%’

 

Advertisements

One thought on “Search Records with Single Quotes in Sql Server

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s