Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Tue, 18 Mar 2008 20:58:48 -0700 (PDT),    group: microsoft.public.sqlserver.fulltext        back       


a problem related to full-text search   
Hi all, I need a help for a problem related to full-text search.
Suppose I have Table A and Table B as following.

Table A
   ID      Data
-------------------------
   1       W1 W2 W3
   2       W2 W4
   3       W3 W1 W5
   4       W4 W5

Table B
   ID     Keyword
-------------------------
    1      W1
    2      W5

Can I use full-text search to find records in table A whose [Data]
contains [B.Keyword]?

Thanks
date: Tue, 18 Mar 2008 20:58:48 -0700 (PDT)   author:   Erwin Leonardi

RE: a problem related to full-text search   
Yes it is possible but yu maynot use a traditional join.

What you will haev to do is construct the keywrod from table B into a 
fulltext searchable string - for e.g. uyo want to return records from table A 
whch have both W1 and W5 in tableA.Data.

For this you willl have to do

DECLARE @strKeyword Varchar (255)
SET @strKeyword = 'W1 AND W5'

SELECT A.* from ContainsTable (TableA, *, strKeyword)


So in above you have to contruct the strKeyword from tableB.Keyword to make 
this work

Hope this helps in solving your problem.

Cheers
Randeep
"Erwin Leonardi" wrote:

> Hi all, I need a help for a problem related to full-text search.
> Suppose I have Table A and Table B as following.
> 
> Table A
>    ID      Data
> -------------------------
>    1       W1 W2 W3
>    2       W2 W4
>    3       W3 W1 W5
>    4       W4 W5
> 
> Table B
>    ID     Keyword
> -------------------------
>     1      W1
>     2      W5
> 
> Can I use full-text search to find records in table A whose [Data]
> contains [B.Keyword]?
> 
> Thanks
>
date: Tue, 8 Apr 2008 08:38:02 -0700   author:   Randeep Sawhney Randeep

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us