Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Name search with Full Text Search
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 01/21/2013 :  17:53:13  Show Profile  Reply with Quote

I'm having trouble implementing a query for searching names on a table PERSON, which has two columns, FORENAME and SURNAME.

I'll use FULL TEXT SEARCH for doing that, and already have created the FULL TEXT CATALOG and the FULL TEXT INDEX on this table.

Supposing that i have the following rows on the table:

1. FORENAME: "Barack" SURNAME: " of Mortal Kombat"
2. FORENAME: "Sadam" SURNAME: "Houssein"
3. FORENAME: "Crystal" SURNAME: "Obakwelu"

And i'm trying to search this name:

. Name to search: "Barack Hussain Obama"

I would do the sql query like this, supposing that @name is a parameter, and it would be passed by the user through the application layer, like a C# program:

declare @name nvarchar(30)
set @name = N'Barack Hussain Obama'

FROM Person

How can i get this working? The problem is in the @name string.
ERROR: Syntax error near 'Hussain' in the full-text search condition 'Barack Hussain Obama'.
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000