Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ok, I'm impressed
Message
From
15/03/2004 16:03:56
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00769562
Message ID:
00886477
Views:
22
>What type of field are you using in SQL to emulate the VFP Memo field type? Is there anything special you have to specify in T-SQL to use the search index feature?

The type of field is Text.

Here is a syntax of what I am doing:
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%'")
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform