Solved

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

Posted on 2016-10-14
6
59 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 33

Expert Comment

by:ste5an
ID: 41843662
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
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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

932 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

20 Experts available now in Live!

Get 1:1 Help Now