Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Comparing data of text column

Author  Topic 

mercure
Starting Member

3 Posts

Posted - 2011-03-01 : 01:48:49
Hello everyone,
I'm comparing data of 2 columns in 2 tables from 2 databases. The columns have the same DDL and they ara Text type.
The request I'm using is
select t1.SPADM_SP_CODE_FK_PK, t1.SPADM_LIBELLE, t2.SPADM_SP_CODE_FK_PK,t2.SPADM_LIBELLE
from THERIAQUE_DEST.theriaque.SPADM_SPECIALITE_MODEADM t1
inner join THERIAQUE_MAJ.theriaque.SPADM_SPECIALITE_MODEADM t2 on t1.SPADM_SP_CODE_FK_PK = t2.SPADM_SP_CODE_FK_PK
where cast(t1.SPADM_LIBELLE as varchar(max)) <> cast(t2.SPADM_LIBELLE as varchar(max))

Normally I must have a difference because the first column contains (350 mg/m²) and the second column contains (350 mg/m2) but nothing is returned.
Can anyone tell me what I must to do resolve this problem

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-03-01 : 10:55:44
Works for me. Sure that they are matching on the JOIN condition?
Go to Top of Page
   

- Advertisement -