Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 select Containstable with like query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-07-10 : 08:53:22
john writes "I have a containsatbale query which i use to return results on a users input. This works fine, but i would like to add an addition statement to search for words where they are 'like'
what is the syntax for this....
My current sql is
set @sql = 'SELECT [KEY],RANK,imageID,imagename, txtdescription,Metkeyword,
metsystamatic,MetSubjectArea,MetType,PictURL, PictFileURL
FROM CONTAINSTABLE(imagebankmeta1,*,'''+ @schParam + ''') C
JOIN imagebankmeta1 P
ON P.imageID = C.[KEY]
where rank > 5
'+ @SchPict +'
ORDER BY RANK DESC'

@schParam is a string produced on as ASP page which contains the words to be searched on. What character is required to enable a string to searched using the like statement...
for sql server 7 it is the * but i am running sql 2000 and this does not seem to work..
any suggestions are greatfully recieved
thanks"
   

- Advertisement -