Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

example of FREETEXTTABLE (Transact-SQL

Hi experts, i am reading about FREETEXTTABLE (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms177652.aspx

but i need an example
unfortunately the example of Microsoft's site does not work. I make it work? or have another example?

this is my code
EXEC sp_fulltext_database 'enable'
EXEC sp_fulltext_catalog 'Cat_Catalog_Categories', 'create'
EXEC sp_fulltext_table 'dbo.Categories', 'create', 'Cat_Catalog_Categories', 'PK_Categories'
EXEC sp_fulltext_column 'dbo.Categories', 'Description', 'add'

USE Northwind;
SELECT FT_TBL.CategoryName
    ,FT_TBL.Description
    ,KEY_TBL.RANK
FROM dbo.Categories AS FT_TBL
    INNER JOIN FREETEXTTABLE(dbo.Categories, Description,
        'sweetest candy bread and dry meat') AS KEY_TBL
        ON FT_TBL.CategoryID = KEY_TBL.[KEY];

does not return any results
categories.jpg
SOLUTION
Avatar of Rahul Agarwal
Rahul Agarwal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enrique_aeo
enrique_aeo

ASKER

acperkins, i do not understand
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok, the example complete is
EXEC sp_fulltext_database 'enable'
EXEC sp_fulltext_catalog 'Cat_Catalog_Categories', 'create'
EXEC sp_fulltext_catalog 'Cat_Catalog_Categories', 'start_full';
EXEC sp_fulltext_table 'dbo.Categories', 'create', 'Cat_Catalog_Categories', 'PK_Categories'
EXEC sp_fulltext_column 'dbo.Categories', 'Description', 'add'

select * from dbo.Categories

USE Northwind;
SELECT FT_TBL.CategoryName
    ,FT_TBL.Description
    ,KEY_TBL.RANK
FROM dbo.Categories AS FT_TBL
    INNER JOIN FREETEXTTABLE(dbo.Categories, Description,
        'sweetest candy bread and dry meat') AS KEY_TBL
        ON FT_TBL.CategoryID = KEY_TBL.[KEY];
GO
>>ok, the example complete is<<
Actually you are missing the step where you wait until the Full Population completes...