Cannot resolve collation conflict for equal to operation

Posted on 2011-04-29
Last Modified: 2012-05-11
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?
Question by:COHFL
    LVL 14

    Accepted Solution

    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]
    ALTER DATABASE <your database name here> COLLATE <your server_collation here>
    -- it could look like

    Open in new window

    LVL 15

    Expert Comment

    by:Aaron Shilo

    use the COLLATE function on the column in your where command

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

    Expert Comment

    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.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
    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.
    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.

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now