How to compare two Text fields using a query?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Danny Mansour (anonymous_at_discussions.microsoft.com)
Date: 06/11/04


Date: Fri, 11 Jun 2004 08:41:40 -0700

Hi,

I have two tables T1 and T2 that have identical
structure, an Id field as int and a Description field as
text. The text fields contain large data.

The content of the table could be like this:

T1:
Id Description
1 text more than 8000 characters

T2
Id Description
1 some text

I want to compare the Description fields with a query as
such:

Select T1.Id FROM T1 INNER JOIN T2 on T1.Id = T2.Id
WHERE NOT T1.Description LIKE T2.Description

SQL server throws a "Data type mismatch - use the CONVERT
function." error message.

I can not use the convert function because I don't want
to downcast a text field to a varchar since my data is
larger than 8000 characters.

Is there any other ways to doing this using a query?
Please let me know if you have any ideas.

Thanks,
Danny



Relevant Pages

  • Complicated query
    ... QTopic [varchar 50] ... Term [int] - Validity in months from the current date. ... The problems are to write a query to get the question list for a patient ...
    (microsoft.public.sqlserver.programming)
  • Re: HowTo: Append Data to a table stored in another database?
    ... ID int ... Name varchar ... What I need is a query that checks if the ID is in table b or not - if not, ... >> I have database A with table a and I have database b. ...
    (microsoft.public.sqlserver.server)
  • RE: Query help (JOIN on own table)
    ... > id int not null, ... > source varchar not null ... > 1 testOne One ... > I've managed to it with the query at the bottom, but I'm not too happy about ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL DataMart help
    ... The problem you have is that your keys are not the same so the Join is not ... You could fix it by converting the int into varchar (though this ... > with characters ...
    (microsoft.public.sqlserver.datawarehouse)
  • Re: Truncated Memo field displayed on form
    ... 255 characters in any column that is in the combo box's RowSource query. ... My fields down to "Knowledge and Understandings" are fine. ... occurs with the "descriptor" field being truncated on my form. ...
    (microsoft.public.access.forms)