I have a table (MyTable) with the following columns:
Col1: NameID VARCHAR (50) PRIMARY KEY NOT NULL Col2: Address VARCHAR (255)
Sample data:
Name: '1 24' Address: '1234 Main St.'
and I made a full text index in the table after creating the directory using the default parameters.
How can I execute the following query:
SELECT * FROM MyTable WHERE CONTAINS(NameID, '1') AND CONTAINS(Address, 'Main St.');
But my query does not return any results, which does not make sense, because it works:
SELECT * FROM MyTable WHERE CONTAINS(Address, 'Main St.');
so:
SELECT * FROM MyTable WHERE CONTAINS(Address, 'Main St.') AND NameID LIKE '1%'
but this also does not work:
SELECT * FROM MyTable WHERE CONTAINS(NameID, '1');
Why can't I execute the query in the indexed column of the primary key (Name) when I selected this column to be included in the Address column when setting up the full-text index?
Thanks in advance!
contains sql-server-2008 full-text-search
Rachael
source share