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

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. 【线性判别】Fisher线性判别(转)

    今天读paper遇到了Fisher线性判别的变体, 所以来学习一下, 所以到时候一定要把PRMl刷一遍呀 以下两篇论文一起阅读比较好: 论文1: https://blog.csdn.net/Rainb ...

  2. 【jdk源码分析】java多线程开启的三种方式

    1.继承Thread类,新建一个当前类对象,并且运行其start()方法 package com.xiaostudy.thread; /** * @desc 第一种开启线程的方式 * @author ...

  3. 基于Redis的限流系统的设计

    本文讲述基于Redis的限流系统的设计,主要会谈及限流系统中限流策略这个功能的设计:在实现方面,算法使用的是令牌桶算法来,访问Redis使用lua脚本.   1.概念 In computer netw ...

  4. php入门(一)

    一,在HTML中嵌入php代码 先看html的代码: <form action="processorder.php" method="post"> ...

  5. 关于MAC升级后,vim更新插件报错

    找不到路径: 直接在终端 terminal 输入: xcode-select --install

  6. pandas 运算

    Data frame 和 series 的运算:横列相加减:按照index ,row 的方向直接相加减.frame-series纵列相加减:按照 columns,运用算术函数,相加减. frame.s ...

  7. android之代码混淆

    项目发布之前混淆是必不可少的工作,混淆可以增加别人反编译阅读代码的难度,还可以缩小APK包. Android 中通过ProGuard 来混淆Java代码,仅仅是混淆java代码.它是无法混淆Nativ ...

  8. UVA-11324 The Largest Clique (强连通+DP)

    题目大意:在一张无向图中,最大的节点集使得集合内任意两个节点都能到达对方. 题目分析:找出所有的强连通分量,将每一个分量视作大节点,则原图变成了一张DAG.将每个分量中的节点个数作为节点权值,题目便转 ...

  9. label技巧

    问题描述: 一般都用label的for属性指定label的点击范围: <label for="male"><input type="radio" ...

  10. SecureCRT 7.0破解

    激活步骤如下: 1)准备工作:安装好SecureCRT软件,下载并得到该注册机. 2)保持SecureCRT软件关闭(运行的话会提示你正在运行的,关闭就好). 3)将注册机拷贝到你的CRT软件的安装的 ...