Solved

collation conflict

Posted on 2006-07-24
4
804 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
  • 2
4 Comments
 
LVL 23

Accepted Solution

by:
apresto earned 125 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

733 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