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 |
|
svadakattu
Starting Member
2 Posts |
Posted - 2007-07-02 : 15:47:30
|
| Hi,I am having a problem with the use of NEAR in CONTAINS Transact-SQL. Its working fine for queries which say 'apple near lemon' but is not giving the results for queries which have parameters for example '@keyword1 near @keyword2'.Should I use a different syntax? Can somebody help me with this?SravanMS CSEUHEDIT (from tkizer): moved topic out of Script Library forum |
|
|
dbwilson4
Yak Posting Veteran
50 Posts |
Posted - 2007-07-02 : 19:02:28
|
| do it like this"SELECT * FROM table WHERE LIKE @keyword1 + ' near ' + @keywword2"; |
 |
|
|
svadakattu
Starting Member
2 Posts |
Posted - 2007-07-02 : 23:05:03
|
| Hey Wilson,Thanks for replying.I tried it for the below query but didnt work. Do you mean we can get the same results by using Like instead of containsSELECT seriesid,lastname,Series.comments FROM Patient, Study, Series WHERE to_patientid = patientid and to_studyid = studyid and Contains((Series.comments), @keyword_1 + 'near' + @keyword_2 )MS CSEUH |
 |
|
|
|
|
|