Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Char(100) field VS Text
Message
 
To
19/04/2012 10:20:42
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01542085
Message ID:
01542106
Views:
29
>>Maybe I'm not reading what you're saying right, but Varchar and nVarchar are indexable w/o full text indexing. Searching for things starting with whatever works fine on varchar and nvarchar.
>
>If you try to search for an exact match on one of those fields, you will get:
>
>"The data types text and varchar are incompatible in the equal to operator."
>
>As for Like 'Someting%', this was not as optimized for the search as when I use it for a Char field. But, in my case, I was not interested with the Like. So, searching for an exact match with a varchar field, we are stucked. Is this your findings as well?


It sounds like you are searching for something that is of type TEXT in a varchar field.

First of all - never use TEXT!!

this works fine..

Declare @findMe varchar(10)
set @findMe = 'hello'

Select * from mytable where myfield = @findMe
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform