Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Collation problem

Author  Topic 

hasanali00
Posting Yak Master

207 Posts

Posted - 2006-06-26 : 09:00:09
Hi
I wonder if you help me with this problem.

When I was installing MSSQL server, for some reason I chose the collation as 'SQL_Latin1_General_CP1_CI_AS'

However for one of my SPs, I received this error:
"error 446: cannot resolve collation conflict for like operation"

So I altered the collation of my database to 'Latin1_General_CI_AS'.

However, I am still getting the same collation error.
So please advise me what is the best solution.

Thanks very much.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-26 : 09:27:34
All columns/fields created after initial installation are coded with the original collation. You must change them as well or convert them "on-the-fly" in the SP.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-06-26 : 13:52:18
We use an explicit collation of every database column creation, and also on all temporary table columns (i.e. varchar / char / text and 'N' variations of those)

This gets around the problem, except where we have to compare [string] columns between databases of different collations (which is pretty rare!)

Kristen
Go to Top of Page

hasanali00
Posting Yak Master

207 Posts

Posted - 2006-06-27 : 05:21:26
I thought the easiest option for me would have been re-installing the SQL server. But when I re-installed MSSQL, my default collation is still 'SQL_Latin1_General_CP1_CI_AS'.

Here is my full story:

Machine 1
1 - I installed MSSQL and the default collation is 'Latin1_General_CI_AS' ( I dont remember modifying this option )
2 - I wrote some SPs, and they work.

Machine 2
1 - I installed MSSQL and the default collation is 'SQL_Latin1_General_CP1_CI_AS' ( I may have selected this option, but I cannot remember ).
2 - With this MSSQL, some of my original SPs dont work.

So today, I have un-installed and re-installed MSSQL on Machine 2. But the default collation is still coming out as 'SQL_Latin1_General_CP1_CI_AS'.

SO my questions are:
1 - How come on Machine 2, the default collation is set to 'SQL_Latin1_General_CP1_CI_AS' whereas on Machine 1, the default collation is 'Latin1_General_CI_AS'?
2 - How can I set the collation to 'Latin1_General_CI_AS' when I am installing MSSQL?

Thanks very much
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-27 : 05:28:51
There is a step when installing SQL Server where you select Collation / Code Page for installation. Hard to miss, unless you are installing SQL Express or SQL Anywhere?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -