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. mongodb的学习-6-命令简单使用

    1.创建数据库 use DATABASE_NAME 举例说明: > use another //创建了数据库another switched to db another > db anot ...

  2. 分布式缓存技术redis系列(一)——redis简介以及linux上的安装

    redis简介 redis是NoSQL(No Only SQL,非关系型数据库)的一种,NoSQL是以Key-Value的形式存储数据.当前主流的分布式缓存技术有redis,memcached,ssd ...

  3. 关于NRF52832能否被替代的详解

    ULP无线系统级芯片 nRF52832是用于ULP无线应用的功能强大的多协议单芯片解决方案.它结合了业界性能最佳的Nordic最新无线收发器.ARM Cortex M4F CPU和512kB闪存及64 ...

  4. 最简单的ASP.Net连接查询Oracle,输出查询数据到表格中

    VS2012中新建Windows窗体应用程序.Oracle中建测试数据表Test.(此处需要环境已配好情况下进行操作) 用到的数据表 向Windows窗体应用程序,设计界面托一个按钮和一个数据表格视图 ...

  5. Unity3D游戏开发从零单排(三) - 极速创建狂拽酷炫的游戏地形

    提要 在Unity工作流程内,地形是一个必不可少的重要元素.不论是游戏或虚拟现实都会使用到各种类型的地形效果,在这个教学中我们须要了解到地形的制作基本概念与,当中对于Unity的地形操作部分须要大量的 ...

  6. Linux服务-ftp

    目录 1. ftp简介 2. ftp架构 3. ftp数据连接模式 4. 用户认证 5. vsftpd 5.1 vsftpd安装 5.2 vsftpd配置 5.3 vsftpd实验配置 5.3.1 安 ...

  7. uva 1590 - IP Networks(IP地址)

    习题4-5 IP网络(IP Networks, ACM/ICPC NEERC 2005, UVa1590) 可以用一个网络地址和一个子网掩码描述一个子网(即连续的IP地址范围).其中子网 掩码包含32 ...

  8. 使用uliweb创建一个简单的blog

    1.创建数据库 uliweb的数据库都在models.py文件里面,因此先创建该文件 vim apps/blog/models.py 添加如下两行: #coding=utf-8 from uliweb ...

  9. css文字环绕

    html: <div class="wrap-div-topSpacer"></div> <div class="wrap-div" ...

  10. BZOJ4145_The Prices_KEY

    题目传送门 看到M<=16经典状态压缩的数据范围,考虑题目. 一道类似于背包的题目. 设f[i][j]表示前i个商店,物品购买状态为j. 先将f[i][j]加上w[i](到i的路费),转移一次, ...