Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2007-11-20
7
Medium Priority
?
2,208 Views
Last Modified: 2008-02-01
I have a Flex Application that calls a CFC with a SQL Insert Statement that continuously returns a SQL Server Error of : The data types varchar and text are incompatible in the equal to operator."

The SQL statement I am getting an error with is attached.

I oddly enough am having no trouble with my update statement.  

I am new to using SQL Server so I am sure it is just some rookie mistake. Thanks in advance.

Jere

insert into dbo.SiteTypes(SiteType)
				values (
					'test' 
				)

Open in new window

0
Comment
Question by:jeresimpson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 600 total points
ID: 20321420
is this SQL Server 2005 ? in such case replace the 'text' datatype with  'VACHAR(MAX)
0
 

Author Comment

by:jeresimpson
ID: 20321906
The current datatype of the field SiteType was varchar(50)  I changed it to varchar(MAX) and now I still get the same error, it just now says varchar(max) instead.
ERROR:
The data types varchar(max) and text are incompatible in the equal to operator.
0
 

Author Comment

by:jeresimpson
ID: 20321912
And yes it is SQL Server 2005.

Thanks for your help aneeshattingal
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 25

Expert Comment

by:imitchie
ID: 20322419
you probably have a trigger on that table that is comparing it to some other table. can you check?
0
 

Author Comment

by:jeresimpson
ID: 20322679
imitchie:

No triggers.

Thanks
0
 
LVL 25

Accepted Solution

by:
imitchie earned 400 total points
ID: 20323025
it's quite impossible for the SQL statement
insert into dbo.SiteTypes(SiteType) values ('test')
on it's own to generate an error of type
"The data types varchar and text are incompatible in the equal to operator."
something else is happening, maybe you can trace the sql server?
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 600 total points
ID: 20324999
SELECT table_name, column_name FROM information_schema.columns
where data_type = 'text'
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question