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. package.xml

    package.xml 也是一个catkin的package必备文件, 它是这个软件包的描述文件, 在较早的ROS版本(rosbuild编译系统)中, 这个文件叫做 manifest.xml , 用于 ...

  2. 文件操作示例脚本 tcl

    linux 下,经常会对用到文件操作,下面是一个用 tcl 写的文件操作示例脚本: 其中 set f01 [open "fix.tcl" w] 命令表示 打开或者新建一个文件“fi ...

  3. YUV与RBG的装换公式

    Y’ = 0.257*R' + 0.504*G' + 0.098*B' + 16 Cb Cr R) G) - 0.392*(Cb'-128) B)

  4. UNIX网络编程 卷2 源代码使用

    1. 下载源码,W. Richard Stevens的主页:http://www.kohala.com/start/ wget http://www.kohala.com/start/unpv22e/ ...

  5. .NET中Quartz任务调度器的简单应用实例

    1.首先从NuGet中安装Quartz,安装最新版本就OK 2.新建一个Job类实现Quart中的IJob接口用于执行业务逻辑,代码如下: class CheckUpdateJob : IJob { ...

  6. linux查看日志文件内容命令(面试被常问到的问题)

    tail -f test.log 你会看到屏幕不断有内容被打印出来. 这时候中断第一个进程Ctrl-C, linux 如何显示一个文件的某几行(中间几行) 从第3000行开始,显示1000行.即显示3 ...

  7. pc端js常用方法

    var common = {}; /** * [pageMask ajax统一请求] * @return {[type]} [description] */ common.pageMask = fun ...

  8. eclipse各种小图标含义

    参考:https://wenku.baidu.com/view/69a0854df7ec4afe04a1df63.html outline:  实心的代表方法  空心的代表属性  绿色的圆表示公有pu ...

  9. 2017-2018-1 20155209 实现mypwd

    2017-2018-1 20155209 实现mypwd 1 学习pwd命令 2 研究pwd实现需要的系统调用(man -k; grep),写出伪代码 3 实现mypwd 4 测试mypwd 首先使用 ...

  10. 20155235 《网络攻防》 实验一 逆向及Bof基础实践说明

    20155235 <网络攻防> 实验一 逆向及Bof基础实践说明 实验目的 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调用foo函数,foo函 ...