今天遇到一个较为头痛的问题:

Cannot resolve the collation conflict between "Chinese_PRC_90_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.

SQL2008 R2,数据库是从SQL2005的备份文件还原回来的。

估计是因为各种环境问题从而导致同一个数据库不同的表中的列有不同的Collation设置,导致在通过这样的字段连接两个表的时候报上面的错误。

有几个不错的连接描述了相关问题:

http://technet.microsoft.com/en-us/library/hh230914.aspx

http://blog.sqlauthority.com/2008/12/16/sql-server-find-collation-of-database-and-table-column-using-t-sql/

http://www.mssqltips.com/sqlservertip/2901/how-to-change-server-level-collation-for-a-sql-server-instance/

但是执行这个SQL:

SELECT distinct collation_name FROM sys.columns

列出了五六种不同的设置,可能涉及到很多表和字段,总不可能一个一个去改吧。

报着试一下的心理:把这个数据库的数据导出到另一个数据库(也是2008R2),看能不能解决这个问题。结果还真管用,不用一个一个去改了。

用的工具是:SQL Server Management Studio

这里的导出不是备份,通常是Backup成一个文件再还原到另外一个数据库。

我用的导出是点数据库的右键,选择Export Data,这样导出数据库就可以。

SQL Server, Cannot resolve the collation conflict的更多相关文章

  1. sql server Cannot resolve the collation conflict between "Chinese_PRC_BIN" and "Chinese_PRC_CI_AS" in the equal to operation

    今天查询二个db,出现这个错误,二种方法,一种是把db里的collation改成一样的:如果不方便可以直接在sql语句后面转一下: select * from table where crm_mscr ...

  2. 解决SQL Server的cannot resolve the collation conflict问题

    当没有牵涉到两个不同的数据库时,出现以上错误.   Cannot resolve the collation conflict between "Chinese_PRC_CI_AS" ...

  3. Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_100_CI_AS" in the equal to operation.

    ErrorMessage Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" ...

  4. Cannot resolve the collation conflict between "Chinese_PRC_CI_AS" and "SQL_L及由于排序规则不同导致查询结果为空的问题

    报错:Cannot resolve the collation conflict between "Chinese_PRC_CI_AS" and "SQL_L 出错原因: ...

  5. Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Chinese_PRC_CI_AI" in the equal to operation.

    Executed as user: NT AUTHORITY\SYSTEM. Cannot resolve the collation conflict between "Chinese_P ...

  6. sql server 小技巧(6) Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "Chinese_PRC_CI_AS" in the equal to operation

    今天查询二个db,出现这个错误,二种方法,一种是把db里的collation改成一样的:如果不方便可以直接在sql语句后面转一下: select * from table where crm_mscr ...

  7. 设置与使用SQL Server的字符集(Collation,即排序规则)

    目录 目录 正确认识SQL Server的字符集 选择合适的SQL Server字符集 错误使用SQL Server的字符集 参考资料 正确认识SQL Server的字符集 SQL Server作为一 ...

  8. Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Chinese_PRC_CI_AS" in the equal to operation.

    Scenario : 这个问题是我的存储过程中用到临时表时发生的. 应该是sql server 服务器的排序规则 (SQL_Latin1_General_CP1_CI_AS ) 与数据库的排序规则(C ...

  9. Sql server中Collation conflict问题

    SQL语句查询时select A.Code,A.Name,a.Systemcode,B.ID,B.LogType,B.DMCode,B.IP,B.Department,B.CreateBy,B.Cre ...

随机推荐

  1. dp_train_f

    Vasya And The Mushrooms 题目大意:有2n个格子,分成上下两行,每行n个,每个格子有蘑菇每秒的生长值(rate),小姑娘从左上角出发(time=0),每秒必须移动,而且只能移动到 ...

  2. Stm32F103面向对象编程之GPIO

    STM32F103 GPIO面向对象变成实例 创建一个GPIO对象 GpioClass gStateLed = NEW_GPIO(C, 0, GPIO_Mode_Out_PP); 初始化对象 Gpio ...

  3. c#实现任务栏添加控制按钮

    Windows7Taskbar的使用 你需要引入3个文件VistaBridgeLibrary.dll.Windows7.DesktopIntegration.dll.Windows7.DesktopI ...

  4. TSP - 状态压缩dp

    2017-08-11 21:10:21 艾教写的 #include<iostream> #include<cstdio> #include<cstring> #in ...

  5. 2018 ICPC北京 H ac自动机

    n=40的01串,求有多少m=40的01串中包含它,包含的定义是存在子串有至多一个字符不相同 600组n=15的数据 15组n=40的数据,所以我们只能支持n^5的算法. 陷入两个比较有意思的坑: 1 ...

  6. Springcloud/Springboot项目绑定域名,使用Nginx配置Https

    https://blog.csdn.net/a_squirrel/article/details/79729690 一.Https 简介(百度百科) HTTPS(全称:Hyper Text Trans ...

  7. C和C#两种方式实现邮件的简单发送

    内容为通过两种方式发送邮件--1.C语言发送邮件   2.C#发送邮件 一,C语言进行邮件的发送 C语言发送邮件的步骤的简单解析: 1.创建TCP连接    socket() 2.连接到邮箱服务器  ...

  8. iOS学习-字符串的删除替换

    字符串的常用处理,删除,替换.记录一下,方便查找. -------------------------------------------------------------------------- ...

  9. Java 基于javaMail的邮件发送(支持附件)

    基于JavaMail的Java邮件发送Author xiuhong.chen@hand-china.com Desc 简单邮件发送 Date 2017/12/8 项目中需要根据物料资质的状况实时给用户 ...

  10. python异常列表

    http://www.runoob.com/python/python-exceptions.html https://www.cnblogs.com/zhangyingai/p/7097920.ht ...