Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change encoding (collation?) of SQL Server 2008 R2 to UTF-8

We'd like to move our Confluence system to a SQL Server 2008 R2. Now, since Confluence uses UTF-8 encoding, I'd need a database using the same encoding (I guess that's the collation?).

There's the command

alter database confluence set collation COLLATION_NAME

Now, as it seems, there is no utf-8, and as I found out SQL Server uses ucs-2 which is basically the same. But I can't figure out what the collation name of ucs-2 would be? Does somebody know about that?

Edit: I do see the difference between encoding and collation now. The Confluence documentation suggests that I should create an schema which relies on UCS-2 (because MS SQL has missing support for UTF-8). I have looked trough the Managment Studio and I found an entry for schemas in the Security directory of the database. However, I can not figure out how to assign UCS-2 encoding to the schema. What do I have to realize this in the Managment Studio to do so (or which query should I use)?

like image 623
Ahatius Avatar asked Nov 23 '12 12:11

Ahatius


1 Answers

According to the confluence documentation you should set the collation to SQL_Latin1_General_CP1_CS_AS

We have followed this document and have had a successful confluence deployment on SQL Server 2008 R2:

Database Setup for SQL Server

like image 97
steoleary Avatar answered Sep 16 '22 20:09

steoleary