Link to home
Start Free TrialLog in
Avatar of dba123
dba123

asked on

The data types text and varchar are incompatible in the equal to operator


select * from notes where comment = 'Status change gg toyy'

the stupid comment field in this system is type text in SQL so how do I get around this error:

The data types text and varchar are incompatible in the equal to operator.
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>you need to use 'Contains '
that is only working if the field "notes" has been added into a full-text search catalog !
Avatar of dba123
dba123

ASKER

select * from notes where comment CONTAINS 'Status change gg toyy'
Avatar of dba123

ASKER

I'd love to get rid of the text field Angel but this is a stupid s***ty ass 3rd party piece of S**t

SELECT *
FROM notes
WHERE CONTAINS(ProductName, '"Status change gg toyy" ')
Avatar of dba123

ASKER

It's amazing how these 3rd party companies out there today (even IBM with their s***ty ass ClearQuest) can charge a ton for such a S**ty application design.
Avatar of dba123

ASKER

time for me to go into business??  anyone want to hop aboard...jk
As angel suggested , you should enable full text indexing on 'Comments'
Avatar of dba123

ASKER

yea, well I don't know if that will break the system for this API that I don't work with....I could enable that but if our network guys start to get calls on slow performance then guess who they come to first!
Avatar of dba123

ASKER

sorry for all the swearing, I just can't believe what I see in 3rd party apps these day...disgusting.
if you don't dare implementing the full-text search on it (btw, I doubt this will not be working anyhow for exact match), you should try out my very first comment
Avatar of dba123

ASKER

Thanks much!