CLEAR ALL CLOSE ALL SQLSETPROP(0,'DispWarnings',.F.) SQLSETPROP(0,'DispLogin',3) SQLSETPROP(0,'ConnectTimeOut',2) * Get the handle lnHandle=SQLStringConnect('Driver=SQL server;Server=MyServer; Database=MyDatabase') * Create a full-text catalog SQLExec(lnHandle,"sp_fulltext_database 'enable'") MD D:\SQLServerNews SQLExec(lnHandle,"sp_fulltext_catalog 'Thread', 'create', 'd:\SQLServerNews'") * Create index on Numero SQLExec(lnHandle,'CREATE UNIQUE INDEX [Numero] ON [dbo].[Thread] ([numero]) WITH DROP_EXISTING ON [PRIMARY]') * Create full-text support SQLExec(lnHandle,"sp_fulltext_table 'Thread', 'create', 'Thread', 'Numero'") * Add the fields to be indexed * We want to speed up the search on the title and notes fields SQLExec(lnHandle,"sp_fulltext_column 'Thread', 'Title', 'add'") SQLExec(lnHandle,"sp_fulltext_column 'Thread', 'Notes', 'add'") * Generate the index SQLExec(lnHandle,"sp_fulltext_table 'News', 'start_full'") * Verify indexing SQLExec(lnHandle,"select FULLTEXTCATALOGPROPERTY('Cat_Desc', 'Populatestatus')") * Search to return only the key in the first SQL and then establish a relationship with the Visual FoxPro table SQLExec(lnHandle,"SELECT [key] AS Numero,[rank] FROM FREETEXTTABLE(News, NotesA, 'data')") SELECT News.* FROM News INNER JOIN SQLResult ON News.Numero=SQLResult.Numero INTO CURSOR Temp * Another search where we return all fields SQLExec(lnHandle,"select * from News where NotesA LIKE '%DATA%'")