From: mavrick_101 on
Hi,

I have two queries that I'm using UNION on.

The queries run fine individually but when I use UNION, it gives me an error
complaining about collation.

In the first query, I had to use COLLATE SQL_Latin1_CP1_I_AS on one of the
columns.

Thanks for your help.

From: John Bell on
On Wed, 24 Feb 2010 10:37:01 -0800, mavrick_101
<mavrick101(a)discussions.microsoft.com> wrote:

>Hi,
>
>I have two queries that I'm using UNION on.
>
>The queries run fine individually but when I use UNION, it gives me an error
>complaining about collation.
>
>In the first query, I had to use COLLATE SQL_Latin1_CP1_I_AS on one of the
>columns.
>
>Thanks for your help.

So he column in one half of the union has the SQL_Latin1_CP1_I_AS
collation or a compatible one and the column in the second half of he
query has a incomptible collation and you force this with the COLLATE
clause.


In general I would expect collations to be consistent, and you can use
ALTER TABLE .. ALTER COLUMN to change the collation.

You can look in sys.columns to see which columns use the given
collations.

John