• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2216
  • Last Modified:

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

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
jeresimpson
Asked:
jeresimpson
  • 3
  • 2
  • 2
3 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
is this SQL Server 2005 ? in such case replace the 'text' datatype with  'VACHAR(MAX)
0
 
jeresimpsonAuthor Commented:
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
 
jeresimpsonAuthor Commented:
And yes it is SQL Server 2005.

Thanks for your help aneeshattingal
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
imitchieCommented:
you probably have a trigger on that table that is comparing it to some other table. can you check?
0
 
jeresimpsonAuthor Commented:
imitchie:

No triggers.

Thanks
0
 
imitchieCommented:
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
 
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT table_name, column_name FROM information_schema.columns
where data_type = 'text'
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now