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

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. 生信实验室收集---Dana Pe'er Lab

    Dana Pe'er Lab of Computational Systems Biology Dana Pe'er是哥伦比亚大学生物科学系的副教授,被认为是计算系统生物学的主要研究人员之一.Dana ...

  2. Tachyon:Spark生态系统中的分布式内存文件系统

    转自: http://www.csdn.net/article/2015-06-25/2825056  摘要:Tachyon把内存存储的功能从Spark中分离出来, 使Spark可以更专注计算的本身, ...

  3. Docker Mysql主主同步配置搭建Demo

    主主同步配置和主从配置很相似,仅需稍做修改就可以了,对主从配置有疑问可以查看 上一篇文章. 进行Docker操作前,先建立目录,我的路径是d:/docker/mysql,目录结构如下: --mysql ...

  4. php 模拟 asp.net webFrom 按钮提交事件

    由于公司需要php方面的项目开发,php刚刚入门,在写按钮提交过程中,asp.net里的按钮事件更好些.先看下面的代码, <? require_once '../inc/EventHelper. ...

  5. DNS和Bind配置指南

    /////////////////////////////目录//////////////////////////////////////一.DNS原理相关二.使用bind搭建最简单的DNS服务器三. ...

  6. UVA-10537 The Toll! Revisited (dijkstra)

    题目大意:每经过一个地方就要交出相应的货物作为过路费,问将一批货物从起点运到终点,最少需要携带多少货物? 题目分析:在每一站交的过路费由当前拥有的货物量来决定,所以,要以终点为源点,求一次单源最短路即 ...

  7. Windows音频SDK的发展历程

    WASAPI is one of several native audio libraries in Windows. PortAudio actually supports five of them ...

  8. windows下使用selenium报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH

    问题 :执行程序代码报错: WebDriverException:Message:'geckodriver'executable needs to be in Path 或者 selenium.com ...

  9. PyCharm在win10的64位系统安装实例

    搭建环境 1.win10_X64,其他Win版本也可以. 2.PyCharm版本:Professional-2016.2.3. 搭建准备 1.到PyCharm官网下载PyCharm安装包. 2.选择W ...

  10. neutron源码分析(一)OpenStack环境搭建

    一.OpenStack安装 安装一个初始化的Mitaka版本的OpenStack环境用于分析,neutron源码 序号 角色 IP地址 版本 1 controller 172.16.15.161 mi ...