SQL Server – Collation problem

All my servers have a default collation of Latin1_General_CPI_CI_AR. Apart from one that is. It was rebuilt with the wrong collation of Latin1_General_CI_AR. This is causing problems with an application and the collation needs to be changed to be the same as all the other servers.

For most of the tables I had the collation problem while transferring to server or with a few queries. I found the following solution.

SELECT ID
FROM ItemsTable
INNER JOIN AccountsTable ON ItemsTable.Collation1Col COLLATE DATABASE_DEFAULT = AccountsTable.Collation2Col COLLATE DATABASE_DEFAULT

Advertisements

~ by UTS on May 17, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: