hai all

i am facing some problem in SQL.I am searching the one string(ex.roll-over) in table
its returning wrong results.
my table contains,

dable datas
table_1 is table name
number1 text1
1 notify us the day you roll check over.
2 notify us theday you roll check .
3 notify us the day you roll check roll-over.
4 notify us the day you roll check roll over.


my query is
select * from table_1 WHERE CONTAINS(text1, '"roll-over"')
select * from table_1 WHERE CONTAINS(text1, 'roll-over')

in both case i am getting below results.
results
number1 text1
1 notify us the day you roll check over.
2 notify us theday you roll check .
3 notify us the day you roll check roll-over.
4 notify us the day you roll check roll over.

here it should return only one result insted of four.
is there any thing wrong in Query if not can any one help to from the correct query.
i think Bcoz os hyphen the result is returinig either roll or over presents.


thanks
mahe

If you check out

http://msdn.microsoft.com/en-us/library/ms187787.aspx

you'll see in the <simple-term> definition, the CONTAINS predicate ignores punctuation:

Punctuation is ignored. Therefore, CONTAINS(testing, "computer failure") matches a row with the value, "Where is my computer? Failure to find it would be expensive."

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.