I am trying to create FREETEXTTABLE. I am getting this following error.
Msg 7601, Level 16, State 2, Line 1
Cannot use a CONTAINS or FREETEXT predicate on table or indexed view 'Flags' because it is not full-text indexed.
My Sample,
CREATE TABLE Flags (Country nvarchar(30) NOT NULL, FlagColors varchar(200));
CREATE UNIQUE CLUSTERED INDEX FlagKey ON Flags(Country);
INSERT Flags VALUES ('France', 'Blue and White and Red');
INSERT Flags VALUES ('Italy', 'Green and White and Red');
INSERT Flags VALUES ('Tanzania', 'Green and Yellow and Black and Yellow and Blue');
SELECT * FROM Flags;
GO
CREATE FULLTEXT CATALOG TestFTCat;
CREATE FULLTEXT INDEX ON Flags(FlagColors) KEY INDEX FlagKey ON TestFTCat;
GO
SELECT * FROM FREETEXTTABLE (Flags, FlagColors, 'Blue');
Simple way to validate if you have installed the Full Text "component" of MSSQL Server 2008 is to execute the following T-SQL
If this returns a value of '1' then the component is installed.
Else you have to install SQL Server Fulltext search on an existing SQL Server instance.
Finish the wizard and everything should now work, run this sql to confirm:
SELECT SERVERPROPERTY('IsFullTextInstalled')
Now you can Enable Full Text Search With T-SQL
Now you can perform search on indexed columns using CONTAINS, FREETEXT, CONTAINSTABLE or FREETEXTTABLE keywords. For example, let say I want to check all contacts where first name is Maria or Ana:
This SQL query will return results as on image bellow: