티스토리 뷰

-- Behavior

 

Create database db1

Go

 

USE [master]

GO

ALTER DATABASE [db1] COLLATE Korean_100_CI_AS_SC_UTF8

GO

 

use db1

go

 

create table t1 (col1 varchar(10))

 

create table t2 (col1 nvarchar(10))

 

truncate table t1;

truncate table t2;

 

insert into t1 values ('A')

insert into t1 values (N'A')

insert into t1 values ('가')

insert into t1 values (N'가')

 

insert into t2 values ('A')

insert into t2 values (N'A')

insert into t2 values ('가')

insert into t2 values (N'가')

 

--select * from t1

--select * from t2

 

select col1, datalength(col1) from t1

select col1, datalength(col1) from t2

 

Ref.

https://en.wikipedia.org/wiki/UTF-8
https://techcommunity.microsoft.com/t5/sql-server/introducing-utf-8-support-for-sql-server/ba-p/734928
https://docs.microsoft.com/en-us/sql/relational-databases/collations/collation-and-unicode-support?view=sql-server-ver15

댓글
글 보관함
최근에 달린 댓글
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Total
Today
Yesterday