Solved

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

Posted on 2007-11-20
7
2,188 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 150 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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 100 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 150 total points
ID: 20324999
SELECT table_name, column_name FROM information_schema.columns
where data_type = 'text'
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now