collation conflict

  • Hi I have following syntax

    SELECT DISTINCT object.name

    FROM OPENQUERY(MOJAVEZA, 'SELECT name FROM Operator.dbo.sysobjects WHERE xtype != ''S''' ) as object

    WHERE NOT EXISTS

         (SELECT *

           FROM ListOfSystemObjects

           WHERE object.name  =  ListOfSystemObjects.ObjectsName)

    and Operator.dbo.sysobjects  has SQL_Croatian_CP1250_CI_AS

    and ListOfSystemObjects has Cyrillic_General

    when I run it I get

    Cannot resolve collation conflict for equal to operation.

    is there a way to change collation on fly insetad makins some temp variables?

    thanks, Amira

  • Try using this,

    SELECT DISTINCT object.name

    FROM OPENQUERY(MOJAVEZA, 'SELECT name FROM Operator.dbo.sysobjects WHERE xtype != ''S''' ) as object

    WHERE NOT EXISTS

         (SELECT *

           FROM ListOfSystemObjects

          WHERE object.name COLLATE DATABASE_DEFAULT =  ListOfSystemObjects.ObjectsName)

    Normally I use this whenever there is a collation difference in between the database. But in your case, you are using a linked server. Iam not sure how far it is going to help you.

     

    Thanks,

    Ganesh

     

     

     

  • Thank you Ganesh, it did help.

    In the meantime I have created a temp table with different collation, but I will change it and use this trick you gave me. Thanks a lot

    amira

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply