Solved

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

Posted on 2016-10-14
6
42 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
6 Comments
 
LVL 32

Expert Comment

by:Stefan Hoffmann
Comment Utility
Why not searching for "student"? And for the plural form use an additional LIKE.
0
 
LVL 26

Accepted Solution

by:
Zberteoc earned 500 total points
Comment Utility
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
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Expert Comment

by:Andy Woodward
Comment Utility
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
Comment Utility
Thanks all of you for the reply..
0
 

Author Closing Comment

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now