Solved

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

Posted on 2016-10-14
6
77 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL STANDARD CORE 8 40
ASP.NET MVC - Views 3 22
Where does legacy ASP.NET initialize language? 2 26
MS SQL Delete Duplicate Rows Only 2 20
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

828 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