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

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. 爬虫之Handler处理器 和 自定义Opener

    Handler处理器 和 自定义Opener opener是 urllib2.OpenerDirector 的实例,我们之前一直都在使用的urlopen,它是一个特殊的opener(也就是模块帮我们构 ...

  2. 从0开始 数据结构 字典树 hdu1251

    字典树 知识补充 '\0'和'\n'的区别 '\0' 是一个字符串的结尾 '\n' 是换行符 gets 和 scanf 的区别 gets()函数总结: gets() 从标准输入设备读取字符串,以回车结 ...

  3. Zookeeper java api

     Zookeeper java api 主要有以下几个: 方法名称 描述 String create(final String path, byte data[], List acl, CreateM ...

  4. phpstorm 右下角显示updating indices,一直有任务卡着

    其实就是生成的这个node_modules目录内文件太多了,选中node_modules这个目录右键,选择Excluded 一直在加载忽略掉这个文件就可以了

  5. HTML之实现页面缓存

    一般来说,对于html页面,一个站点,每个页面都会有相同的公共文件,比如页面的头部.尾部.侧边栏目.公共JS等.访问站点下的每一个页面,相同的公共文件,都需要重复从服务器下载.从性能和带宽角度看,重复 ...

  6. 基础系列(1)之干掉JavaScript变量作用域

     今天去某顺公司面试,发现一些基础知识都不记得了,于是乎决定把js基础系列的全部梳理一遍,今天就整理下js变量作用域的相关基础知识点,配合最常遇到的笔试题阐述. 题一: var g = "a ...

  7. spring mvc: 生成RSS源

    spring mvc: 生成RSS源 准备: 从相同的maven存储库页面下载 Rome 库及其依赖项rome-utils,jdom和slf4j.和所需的依赖关系 <!-- rss源依赖 --& ...

  8. 1004: [HNOI2008]Cards burnside定理

    https://www.lydsy.com/JudgeOnline/problem.php?id=1004 输入数据保证任意多次洗牌都可用这 m种洗牌法中的一种代替,且对每种洗牌法,都存在一种洗牌法使 ...

  9. Git 常用命令和 Git Flow 梳理

    git 用 git 有一段时间了,之前没有详细地了解 git flow,导致协作过程中或多或少出现了一些头疼问题.最近静下心来理了下 git flow 的整个流程,再回头看开朗了不少,总结到这里.介绍 ...

  10. opencv 图片降噪

    —— # -*- coding: utf-8 -* import numpy as np import cv2 cap = cv2.VideoCapture(0) while True: _ , fr ...