tsql - How to properly frame a collate command in T-SQL? -


i'm trying write query across 2 linked servers. having set link appropriate logon, i'm getting collate error:

cannot resolve collation conflict between "sql_latin1_general_cp1_ci_as" , "latin1_general_ci_as" in equal operation.

this new me, looks charset conflict, googled , discovered collate command can added join. i've tried both

va on v_id1 = c1.strdata collate latin1_general_ci_as 

and

va on v_id1 = c1.strdata collate sql_latin1_general_cp1_ci_as 

and neither seems resolve error. doing wrong?

edit: entire query big post , expect people filter through, here's relevant bit:

   select         rel.intparentattributeid intitemid,         case va.type         when 'sm' 120000000         when 'fb' 110000000         when 'ro' 100000000         when 'sp' 90000000         when 'a' 80000000         when 'd' 70000000         when 'p' 60000000         when 'sr' 50000000         when 'fn' 40000000         when 'rl' 30000000         when 'vo' 20000000         when 're' 10000000         end         +          rel.intparentattributeid         fltstrength                 attributemap ky          join catalogue c1 on c1.introwid=ky.intchildattributeid , c1.intattributetypeid=@intsimilaratt          join          [sqlservername].[schemaname].dbo.vidassc          va on v_id1 collate sql_latin1_general_cp1_ci_as = c1.strdata collate sql_latin1_general_cp1_ci_as           join catalogue c2 on c2.strdata=v_id2 , c2.intattributetypeid=@intsimilaratt          join attributemap rel on rel.intchildattributeid = c2.introwid          join @tmpseeds s on s.intitemid = ky.intparentattributeid          group rel.intparentattributeid,va.type          )sqi 

cheers, matt

try putting collate on left side well:

from table1 t1 inner join table2 t2  on t1.id collate latin1_general_ci_as   = t2.id --collate latin1_general_ci_as --optionally on right if needed. 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -