Hi,
I am getting this error while trying to join two tables on two different
databases.
How can I find out the collation on each and how can I make them similar?
Plz help.
Thnx in advanceMay be the collation of the columns participating in the join are not the
same. You can select from information_schema.columns to see the collation of
those columns and pick one collation to be used with COLLATE clause.
Example:
declare @.t1 table(c1 varchar(25) collate SQL_Latin1_General_CP1_CI_AS)
declare @.t2 table(c1 varchar(25) collate SQL_Latin1_General_CP1_CS_AS)
insert into @.t1 values('microsoft')
insert into @.t2 values('microsoft')
select
*
from
@.t1 as t1
inner join
@.t2 as t2
on t1.c1 = t2.c1 collate SQL_Latin1_General_CP1_CI_AS
if you do not use the "collate" clause in the join, you will get same error
that you mentioned.
AMB
"dotnettester" wrote:
> Hi,
> I am getting this error while trying to join two tables on two different
> databases.
> How can I find out the collation on each and how can I make them similar?
> Plz help.
> Thnx in advance
No comments:
Post a Comment