Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
I want to do a wildcard search using Full-Text Search. For example, I want to know the books that have "Chain" in their names.
Answer
When using the CONTAINS predicate in Full-Text Search, you can enclose the search condition (word or phrase) in double quotation marks ("") and add an asterisk (*) before the ending quotation mark.
SELECT BookID,BookTitile
FROM Books
WHERE CONTAINS(BookTitile,' "Chain*" ')
By this way, all records have a match of words or phrases beginning with "Chain" will be returned.
However, if you specify "*Chain" or "Ch*ain", you will not get the expected result. The asterisk will be considered as a normal punctuation mark not a wildcard character.
More Information
https://msdn.microsoft.com/en-us/library/ms187787.aspx
Applies to
SQL Server 2005
SQL Server 2008
SQL Server 2008 R2
Please sign in to use this experience.
Sign in