How to fix a collation conflict in a SQL Server query?

后端 未结 5 1948
故里飘歌
故里飘歌 2020-12-09 00:53

I am working on a view, wherein I am using an inner join on two tables which are from two different servers. We are using linked server. When running the query I am getting

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 01:33

    I had problems with collations as I had most of the tables with Modern_Spanish_CI_AS, but a few, which I had inherited or copied from another Database, had SQL_Latin1_General_CP1_CI_AS collation.

    In my case, the easiest way to solve the problem has been as follows:

    1. I've created a copy of the tables which were 'Latin American, using script table as...
    2. The new tables have obviously acquired the 'Modern Spanish' collation of my database
    3. I've copied the data of my 'Latin American' table into the new one, deleted the old one and renamed the new one.

    I hope this helps other users.

提交回复
热议问题