Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

collation conflict

Posted on 2006-07-24
4
Medium Priority
?
827 Views
Last Modified: 2010-01-29
Hi:

I map locations from one table to another by doing something like:
 
update mytable
set mylocation=l.location
from mytable as p, locationtable as l
where p.storedid=l.storeid

However, when I test by:

select mylocation from mytable
where mylocation not in (select location from locationtable)

I got the following error message:
Cannot resolve the collation conflict between "Latin1_General_CS_AS_KS_WS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

It sounds like two table/columns have different datatype. But not only they are both varchar, I actually map one column from the other. What's the possible problem here? How do I resolve it? Thanks.
0
Comment
Question by:sdc248
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
apresto earned 500 total points
ID: 17169139
Hi sdc248,

They have a different collation, go into the table design view, at the bottom of the options at the bottom you will see collation, what the error is saying is that your query is trying to select fields of different collations, they need to match, so you might want to change one to match the other



Apresto
0
 
LVL 23

Expert Comment

by:apresto
ID: 17169153
else you could alter the entire database collation witht he following:

ALTER DATABASE yourDatabase COLLATE Latin1_General_CS_AS_KS_WS  -- Your Collation to change to here
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17169155
select mylocation from mytable
where mylocation collate database_default not in (select location collate database_default  from locationtable)
0
 

Author Comment

by:sdc248
ID: 17170275
thanks guys.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question