Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Apostrophe (') in Full-Text Search String SQL server-2016

Posted on 2016-10-14
6
Medium Priority
?
160 Views
Last Modified: 2016-10-17
SELECT * FROM [dbo].[FTSearch] WHERE contains(Context,  'formsof (inflectional,"student''s")  ')
i need to access Apostrophe (') in contains method
Changing the apostrophe into two apostrophes won't work (student''s Document). Been there. Done that. Can't do...

my accepting Result sholud be like
Student's Document
Student's Site
Student's Result.....................Something like this   so my need is that How can I make my full-text search support the apostrophe? If it is indeed not possible, can you provide a link to an article that concludes/proves that MS SQL Server full-text search does not support the apostrophe in the search string?

Thanks In Advance:-)
0
Comment
Question by:Shubham Viramgama
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 35

Expert Comment

by:ste5an
ID: 41843662
Why not searching for "student"? And for the plural form use an additional LIKE.
0
 
LVL 27

Accepted Solution

by:
Zberteoc earned 2000 total points
ID: 41843719
Try this:
SELECT * FROM [dbo].[FTSearch] WHERE contains(Context,  'formsof (inflectional,"student")  ') and Context like '%student''s%'

Open in new window

1
 
LVL 21

Expert Comment

by:Randy Poole
ID: 41843809
Just double up on the single quote since it is inside single quotes
SELECT * FROM [dbo].[FTSearch] WHERE contains(Context,  'formsof (inflectional,"student''''s")  ')

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Expert Comment

by:Andy Woodward
ID: 41843834
Could you simply replace the ' with a ascii character for a ', char(39) so the result would be ('Student' + char(39) + 's Document')
0
 

Author Comment

by:Shubham Viramgama
ID: 41843904
Thanks all of you for the reply..
0
 

Author Closing Comment

by:Shubham Viramgama
ID: 41846433
Thanks for the Solution. it's really helped me. Thanks Again.!!!!:-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question