473,804 Members | 3,088 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot resolve collation conflict for equal to operation.

I've stumbled across the above error and am a little stuck.

I've just installed SQL2000 (sp3) on my PC and restored a database from
our Live server. On a simple Update statement on a #temp table, it
fails with the above message. I think I understand what it means and
found some old posts suggesting using the following :

select name, databasepropert yex(name, 'collation')
from master..sysdata bases
select serverproperty( 'collation')

All of the databases that are there by default are set to
'Latin1_General _CI_AS' and the restored db is
'SQL_Latin1_Gen eral_CP1_CI_AS' .

The live server has all of these set to the 'SQL...' version, but a
standard install points to the other. So, how do I change mine to the
'newer' setting ? All I need to do is mimic the live environment for
testing and development. There is only me using it, and it's not a
problem to bin it and re-install, or tweak if I need to.

I've tried using :

ALTER DATABASE Northwind COLLATE SQL_Latin1_Gene ral_CP1_CI_AS

as a test (thought this was the best example to show), but it fails
stating the following :

Server: Msg 5075, Level 16, State 1, Line 5
The object 'CK_Products_Un itPrice' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 5
The object 'CK_ReorderLeve l' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 5
The object 'CK_UnitsInStoc k' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 5
The object 'CK_UnitsOnOrde r' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 5
The object 'CK_Discount' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 5
The object 'CK_Quantity' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 5
The object 'CK_UnitPrice' is dependent on database collation.
Server: Msg 5075, Level 16, State 1, Line 5
The object 'CK_Birthdate' is dependent on database collation.
Server: Msg 5072, Level 16, State 1, Line 5
ALTER DATABASE failed. The default collation of database 'Northwind'
cannot be set to SQL_Latin1_Gene ral_CP1_CI_AS.

On the Live server, the Northwind database is set to the 'SQL...'
version, so it MUST be do-able somehow.

Any pointers would be appreciated.

Thanks in advance
Ryan

Dec 16 '05 #1
7 85153
Hello, Ryan

In SQL Server, collations can be configured at several levels:
- the default collation for the entire server (instance)
- the default collation of the database
- the collation of the column in some table

I understand that you get the "Cannot resolve collation conflict for
equal to operation" message when you try to compare (by joining, for
example) a column from a temporary table to a column from a normal
table. In this, case the problem is caused by the fact that temporary
tables are stored in the tempdb database, so (unless you explicitly
specify a collation) they get the default collation of the tempdb
database, which is the default collation of the server.

To solve this problem without changing any code, you need to change the
default collation of the server to match the default collation of your
restored database (which is also the default collation of the live
server). In order to change the default collation of the server, you
need to "rebuild the master database" or reinstall SQL Server. See:
http://msdn.microsoft.com/library/en...ar_da_3zw3.asp
http://msdn.microsoft.com/library/en...uildm_6dbt.asp

Razvan

Dec 16 '05 #2
I've looked further into this and tried re-installing SQL2000. Nothing
was any different, and nor was there any option to change the
collation. Now from what I understand, the SQL_ collation was the
default in SQL7 and this then changed in SQL2000. Our server shows SQL_
so I assume it would have been upgraded to SQL2000 at some point
(although I'm told otherwise). We don't have a copy of SQL 7 (which
backs up the none upgrading).

I was thinking of installing 7, then upgrading as this 'should' do the
trick. However, without a copy of SQL7 I'm stuffed. I can't change the
server, so can't figure what the next step would be. All I'm interested
in is matching the server. If I can't do that, then I can't work.

Even if I get a new server, I expect this will give me the same
problems.

I tried using RebuildM.exe and this doesn't give me the option. Is
there any way of adding this ?

Any further ideas ?

Thanks
Ryan

Dec 19 '05 #3
Hi, Ryan

When you install SQL Server, make sure that you choose "Custom" in the
"Setup Type" screen, because the "Collation Settings" screen will not
appear for a "Minimal" or "Typical" installation. In the "Collation
Settings" screen, choose the "Dictionary order, case-insensitive, for
use with 1252 Character Set" SQL Collation.

Razvan

Dec 19 '05 #4
That looks spot on. Thanks for your help.

Ryan

Dec 20 '05 #5
Except that it doesn't fully work now........

All of the collations are set the same (SQL_Latin1_Gen eral_CP1_CI_AS)
and the error I originally got is now showing. It appears on the
following update statement :

UPDATE #Extract SET
PD1 = (SELECT DV.FIELD_VALUE
FROM
DEALER_SOURCE_D ATA_VALUES DV WITH (NOLOCK),
#Max M
WHERE
DV.DEALER_SOURC E_DATA_ID = #Extract.DEALER _SOURCE_DATA_ID AND
DV.FIELD_CODE = #Extract.Line_N o AND -- IT APPEARS ON THIS LINE
AS EXCLUDING IT WORKS, BUT FAILS THE LOGIC NEEDED
#Extract.DSD_YE AR = M.MaxYear AND
#Extract.DSD_MO NTH = 1 AND
DV.FIELD_VALUE <> 0.00000)

Server: Msg 446, Level 16, State 9, Line 5
Cannot resolve collation conflict for equal to operation.

Columns used (to help explain what I've done)
------------------------------------------------------------------
[Line_No] VarChar(75) in #Extract
[FIELD_CODE] VarChar(10) in DEALER_SOURCE_D ATA_VALUES

These should still match and not throw the error I would have
thought......

I've tried the alter database statement just in case it helped, but it
didn't make any difference (as expected).

Maybe I'm just having a bad day, and need a fresh think tomorrow.

Ryan

Dec 20 '05 #6
Hi, Ryan

Check the collations of the columns:

EXEC sp_help 'DEALER_SOURCE_ DATA_VALUES'
use tempdb
EXEC sp_help '#Extract'

Razvan

Dec 21 '05 #7
Sorted, looks like I must have selected case sensitive by mistake.
Re-installed and it all works a treat.

Ta

Ryan

Dec 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3074
by: Bob Bedford | last post by:
I've no access to mysql NG, so I ask here: I've two identical tables (wich are created by usins the same script, but must be separated). When I execute a query wich return fields and do a UNION between them, I get: Illegal mix of collations for operation 'UNION' I had an old mysql version on the server, and since my ISP upgraded, I have
1
3140
by: Chris | last post by:
Has anyone ever accomplished a mass update off all databases, tables and columns for collation? If I try to change the collation/character set for the mysql daemon it breaks all of our queries because they conflict with the swedish default that they have been created with. The problem is we have about 90 databases with hundreds of tables. Is there an easy way to update all of these at once and that would allow me to start with the...
1
1812
by: John Jayaseelan | last post by:
Hi, The tempdb db is having different collation than the application db. I rebuilt the master db with the appropriate collation after backing up master, model, msdb, appln databases. On restore of the databases (master, model, msdb, appln) from the backup restores the backed up database collation.
1
2482
by: pemigh | last post by:
I experienced the same problem that I found posted from summer 2005 (apparently too long ago to continue the thread). See below for full description. I found that reinstalling Access 2000 did the trick. This makes sense based on my observations that 1) the problem didn't show up on replicas on other machines and 2) a little dummy replicated database on my machine behaved this same way. BTW, an explitive burst from me when I first...
21
28052
by: Peter Nurse | last post by:
I have just upgraded to SQL Server 2005 from SQL Server 2000. In Microsoft SQL Server Management Studio, when I click on database properties, I receive the following error:- Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation. (Microsoft SQL Server, Error: 468)
0
1712
by: Carl Gilbert | last post by:
Hi I am trying to get a simple ASP.NET web application to work on my 1&1 (1and1) web space. I managed to get something working a while ago, with thanks to Karl Seguin, but for some unknown reason it stopped working. I have two domains: www.airbrushesonline.com which is directed at a folder on my web space called 'tm' www.airbrushesonline.co.uk which is directed at a folder on my web space
1
2000
by: Frederick Darko | last post by:
Please I Have This Server Running Pefectely Till This Morning An Error Displayed : Server Source Collation Conflict On Equal. This Was Refering To A Particular Table But It Seems That Table Is Not In The Database. Please Help Me.
1
4405
by: Yas | last post by:
Hello, I currently have Table1 and View1. View1 is a query from 2 or 3 tables that works fine on its own. However in my current query if I try to use it...something like... SELECT a.col1, a.col2, a.col3, b.col1, b.col2, b.col3 FROM View1 a JOIN Table1 b on a.col1 = b.col1
2
6147
Uncle Dickie
by: Uncle Dickie | last post by:
Hi All, I am getting the error: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation. when I run a query I have written. The SQL I have written is pretty long (I can post it if needed but don't want to confuse things too much!), but basically it goes something like this: Create temporary table #temp1. Insert Into #temp1 (x 2)
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4288
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.