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.
| Author |
Topic |
|
schadaway
Starting Member
1 Post |
Posted - 2008-09-30 : 13:18:48
|
| Hi,First time post so hi everyone.I'm working with full text searches on 2005 and everything has been working fine. However, I have a situation where people can save their search phrases in a table. Then when a new searched post is created, that post is checked against the previously saved phrases for a match.I thought it would be a simple case of using the contains keyword with the column holding the saved phrases. So for example:CONTAINS(TBL1.FullTextColumn, TBL2.SearchPhrase)but it would seem that the contains keyword can't take a column name as the second argument only a string literal or variable.So firstly, can anyone confirm that this is the case, and if it is would anyone out there have any ideas on how I could get around this issue?I hope I have explained myself clearly there and fingers crossed someone can help me out.Thanks in advanceSteve |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2008-09-30 : 17:30:07
|
| Hello Steve,- yes, CONTAINS can't take a column as the contains_search_condition.- but variable is possibleIdea:declare @SearchPhrase nvarchar(max) -- max or whatever (depending on TBL2.SearchPhrase)select @SearchPhrase=SearchPhrase from TBL2 where ...CONTAINS(TBL1.FullTextColumn, @SearchPhrase)GreetingsWebfredPlanning replaces chance by mistake |
 |
|
|
|
|
|