|
-
May 1st, 2007, 10:31 AM
#1
Thread Starter
Addicted Member
SQL Server
Msg 402, Level 16, State 1, Line 1
The data types text and varchar are incompatible in the equal to operator.
What should I use instead?
Thanks
Another light-hearted post from Guru 
-
May 1st, 2007, 10:40 AM
#2
Re: SQL Server
What gives you that error?
What are you trying to accomplish when you get it?
-
May 1st, 2007, 10:43 AM
#3
Hyperactive Member
Re: SQL Server
You need to compare using 'LIKE', e.g.
SELECT * FROM MYTable WHERE MyTextColumn LIKE 'Value'
-
May 1st, 2007, 02:34 PM
#4
Thread Starter
Addicted Member
-
May 2nd, 2007, 05:20 AM
#5
Thread Starter
Addicted Member
Re: SQL Server
Next question:
How do I a "group by" or "select distinct" on a text field?
Thanks
Another light-hearted post from Guru 
-
May 2nd, 2007, 06:03 AM
#6
Re: SQL Server
What is your complete SELECT statement?
-
May 2nd, 2007, 07:41 AM
#7
Re: SQL Server
Why are you using TEXT fields?
They have many limitations...
-
May 2nd, 2007, 09:41 AM
#8
Thread Starter
Addicted Member
Re: SQL Server
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?
Another light-hearted post from Guru 
-
May 2nd, 2007, 09:48 AM
#9
Re: SQL Server
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.
-
May 2nd, 2007, 09:50 AM
#10
Thread Starter
Addicted Member
Re: SQL Server
OK thanks, I'll give it a go
Another light-hearted post from Guru 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|