[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

Cannot resolve collation conflict for equal to operation

Hi there,
I have a 2000 SQL Server database that stop it working right after it was copy from another SQL server. the error im getting  SqlException: Cannot resolve collation conflict for equal to operation.
It seems like the two collation are some what different but how do i fixed my new database in a effective way?
thanks,
COHFL
0
COHFL
Asked:
COHFL
  • 2
1 Solution
 
Daniel_PLDB Expert/ArchitectCommented:
Change database collation to your server collation:
-- get your server collation by checking master database colaltion
SELECT DATABASEPROPERTYEX('master','collation') AS server_collation

-- change your copied database collation
USE [master]
GO
ALTER DATABASE <your database name here> COLLATE <your server_collation here>
GO

-- it could look like
ALTER DATABASE test_db COLLATE Latvian_CS_AS
GO

Open in new window

0
 
Aaron ShiloCommented:
hi

use the COLLATE function on the column in your where command

select ..
from ..
where columnA = columnB collate Your_colation_type.

http://msdn.microsoft.com/en-us/library/ms184391.aspx
0
 
Daniel_PLDB Expert/ArchitectCommented:
I was suggested by
I have a 2000 SQL Server database that stop it working right after it was copy from another SQL server.
When you are experiencing problems with queries you should use COLLATE as stated by ashilo.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now