The thing about collations is that although database have it's own collation, every table, and every column can have it's own collation. If not specified it takes the default of it's parent object, but can be different.

When you change collation of database, it will be new default for all new tables and columns, but it doesn't change the collation of existing objects inside database. You have to go and change manually the collation of every table and column.

Luckily there are scripts available on the internet that can do the job. I am not going to recommend any as I haven't tried them but here are few links:

http://www.codeproject.com/Articles/302405/The-Easy-way-of-changing-Collation-of-all-Database

Update Collation of all fields in database on the fly

http://www.sqlservercentral.com/Forums/Topic820675-146-1.aspx

If you need to have different collation on two objects or can't change collations - you can still JOIN between them using COLLATE command, and choosing the collation you want for join.

SELECT * FROM A JOIN B ON A.Text = B.Text COLLATE Latin1_General_CI_AS 

or using default database collation:

SELECT * FROM A JOIN B ON A.Text = B.Text COLLATE DATABASE_DEFAULT
 
BUT when I executing
ALTER DATABASE [optimiser] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE [optimiser] COLLATE SQL_Latin1_General_CP1_CI_AS
ALTER DATABASE [optimiser] SET MULTI_USER
i got below error: 
Msg 1205, Level 13, State 68, Line 1
Transaction (Process ID 58) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
 
the solution is:
     in db configuration manager, disable TCP/IP protocol or something similar to cut down all connections, then try the script again.

SQL-Server collation, what is it and how to change db/column collation的更多相关文章

  1. To fix sql server 2008 r2 Evaluation period has expired by change the key

    PTTFM-X467G-P7RH2-3Q6CG-4DMYB 数据中心版:PTTFM-X467G-P7RH2-3Q6CG-4DMYB   测试可用 开 发者 版:MC46H-JQR3C-2JRHY-XY ...

  2. System Databases in SQL Server

    https://docs.microsoft.com/en-us/sql/relational-databases/databases/system-databases SQL Server incl ...

  3. 在64位SQL Server中创建Oracle的链接服务器

    当我们同时使用SQL Server和Oracle来存储数据时,经常会用到跨库查询.为了方便使用跨库查询,一个最好的办法就是通过创建链接服务器来实现.既可以在SQL Server中创建Oracle的链接 ...

  4. SQL Server Analysis Services SSAS Processing Error Configurations

    转载:https://www.mssqltips.com/sqlservertip/3476/sql-server-analysis-services-ssas-processing-error-co ...

  5. SQL: enable sa Account in SQL Server

    Link: http://sudeeptaganguly.wordpress.com/2010/04/20/how-to-enable-sa-account-in-sql-server/ 引用: Wh ...

  6. SQL Server中使用正则表达式

    SQL Server 2005及以上版本支持用CLR语言(C# .NET.VB.NET)编写过程.触发器和函数,因此使得正则匹配,数据提取能够在SQL中灵活运用,大大提高了SQL处理字符串,文本等内容 ...

  7. SQL Server的链接服务器(MySQL、Oracle、Ms_sql、Access、SYBASE)

    原文:SQL Server的链接服务器(MySQL.Oracle.Ms_sql.Access.SYBASE) 一.使用 Microsoft OLE DB Provider For ODBC 链接MyS ...

  8. SQL Server 数据库部分常用语句小结(二)

    9. 查询备份还原数据库的进度. select command ,percent_complete ,est_time_to_go=convert(varchar,(estimated_complet ...

  9. 链接SQL Server服务器

    链接SQL Server服务器:      1.使用 ODBC 的 Microsoft OLE DB 提供程序         EXEC sp_addlinkedserver '别名','','MSD ...

随机推荐

  1. 真机测试出现INSTALL_FAILED_USER_RESTRICTED安装错误

    之前用小米测试的时候遇到一个问题,两个一样型号的手机一个能直接用Android Studio安装公司的项目一个却不可以,总是报INSTALL_FAILED_USER_RESTRICTED错误,具体见下 ...

  2. App界面设计利器Sketch 精选案例合集

    第1章 课程介绍主要介绍课程的安排及你将学到哪些使用技巧 1-1 课程介绍第2章 sketch 实例及相关工具本节课你将学到钢笔工具的使用.渐变及填充.投影的使用,体会并观察实际中物品的光影与材质:模 ...

  3. 定义抽象类Shape,抽象方法为showArea(),求出面积并显示,定义矩形类Rectangle,正方形类Square,圆类 Circle,根据各自的属性,用showArea方法求出各自的面积,在main方法中构造3个对象,调用showArea方法。(体现多态)

    实现多态的三个条件:1.要有继承2.要有抽象方法重写3.用父类指针(引用)指向子类对象 重载重写重定义的区别: 1.重载:在同一个类中进行; 编译时根据参数类型和个数决定方法调用; 子类无法重载父类; ...

  4. HDU1003 最大子段和 线性dp

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1003 Max Sum Time Limit: 2000/1000 MS (Java/Others)  ...

  5. 构建 CDN 分发网络架构

    cdn基本架构: CDN的基本目的:1.通过本地缓存实现网站的访问速度的提升 CDN的关键点:CNAME在域名解析:split智能分发,引流到最近缓存节点

  6. CentOS 7中为Yum设置代理

    公司给的Linux机器,默认没给联网,然后安装Docker时流程走不下去,找IT半天没人回,然后我就自己折腾,各种配置系统代理,结果并没有成功,最后发现yum可以单独为yum设置代理,方式如下: YU ...

  7. U盘安装咱中国人自己的操作系统UbuntuKylin14.04LST(超具体原创图文教程)

    本文仅供參考,在准备级安装过程中出现的一切意外情况均与本文作者无关!原创教程转载请注明原转载地!系统简单介绍:UbuntuKylin 是Ubuntu官方认可的衍生版,其宗旨是创建一个Ubuntu的中文 ...

  8. InnoDB数据页结构

    前言 ​ 关于数据库我们知道是通过内存对磁盘进行操作的,也知道数据会落实到磁盘上,但是数据在磁盘上的存储结构可能大家还不是很清楚. ​ MySQL服务器上负责对表中的数据的读取和写入的工作的部分是存储 ...

  9. jQuery----奇偶选择器和索引选择器

    奇偶选择器: $( " #uu>li:odd").css( " backgroundColor "," red " ); 获取id为u ...

  10. Linux—echo命令

    echo命令的功能是在屏幕上显示一段文字,起到一个提示作用,常用在脚本语言和批处理文件中来在标准输出或者文件中显示一行文本或者字符串. 命令格式:echo [选项] 字符串 选项参数: -n:不在最后 ...