What should I use instead?Quote:
Msg 402, Level 16, State 1, Line 1
The data types text and varchar are incompatible in the equal to operator.
Thanks
Printable View
What should I use instead?Quote:
Msg 402, Level 16, State 1, Line 1
The data types text and varchar are incompatible in the equal to operator.
Thanks
What gives you that error?
What are you trying to accomplish when you get it?
You need to compare using 'LIKE', e.g.
SELECT * FROM MYTable WHERE MyTextColumn LIKE 'Value'
Yay!
Thanks again:)
These may seem pretty simple questions but I very rarely use SQL Server; more familiar with Oracle really....
:thumb:
Next question:
How do I a "group by" or "select distinct" on a text field?
Thanks
What is your complete SELECT statement?
Why are you using TEXT fields?
They have many limitations...
select drive from tbldata group by drive
select distinct drive from tbldata
Typical values for drive would be:
\\000.000.000.000\Apps (D)
\\000.000.000.000\Data (E)
\\000.000.000.000\System (C)
What data type should be used instead of text?
varchar(x) where x is some value for the max length.
nvarchar() is for unicode data - doesn't appear that you have that requirement.
text is for really large fields and has all kinds of limitations - as you have discovered.
OK thanks, I'll give it a go