Colation Problem

May 17, 2006

Hi,
I am using SQLServer 2000 with SP4 and I am getting a strange collation problem.
I have three tables, TEmployee, TMechanic and TManager, each with the two columns Firstname, Lastname which are both varchars.

I run the following query:
<PRE>
SELECT OUTERUNION.FIRSTNAME, OUTERUNION.LASTNAME FROM ((
SELECT QUERY1.FIRSTNAME, QUERY1.LASTNAME
FROM
TEmployee query1 WHERE FIRSTNAME = 'John'
UNION ALL
SELECT QUERY1.FIRSTNAME, QUERY1.LASTNAME
FROM
TCoManager query1 WHERE FIRSTNAME = 'John'
UNION ALL
SELECT QUERY1.FIRSTNAME, QUERY1.LASTNAME
FROM TMechanic query1 WHERE FIRSTNAME = 'John')
UNION
(SELECT QUERY2.FIRSTNAME, QUERY2.LASTNAME
FROM TEmployee query2 WHERE FIRSTNAME = 'Michael'
UNION ALL
SELECT QUERY2.FIRSTNAME, QUERY2.LASTNAME
FROM
TCoManager query2 WHERE FIRSTNAME = 'Michael'
UNION ALL
SELECT QUERY2.FIRSTNAME, QUERY2.LASTNAME FROM TMechanic query2 WHERE FIRSTNAME = 'Michael'
)) OUTERUNION

</PRE>

I get the following error:
Cannot resolve collation conflict for column 2 in SELECT statement.

If I change my select statement to only have one column (doesn't matter which column) it doesn't happen.

Any ideas, greatly appreciated?

View 8 Replies


ADVERTISEMENT

Chinese And Japanese Characters In Same Colation

Jul 20, 2005

SQL 2000, latest SP. We currently have the need to store data from aUTF-8 application in multiple languages in a single database.Our findings thus far support the fact that single-byte anddouble-byte characters can be held in the same DB without issue.However, when holding two sets of DIFFERING double-byte characters(i.e. Chinese and Japanese) there are issues.Since Japanese has a superset of both Kanji and Katakana charactersit's our theory that the Japanese collations will hold Chinese as well(Mandarin).1) Has anybody tried to store multiple languages in the same db? Whatcollation was used?2) Is it possible to change collation by table?3) Which collation of Japanese should be used for best multibyte,UTF-8 character sets? Currently we're testing with Japanese_CI_AS(encoding MS932).Any and all responses appreciated,Join Bytes!

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved