declare @fixedlength char(10),
		@variablelength varchar(10),
		@nvariablelength nvarchar(10)
set @fixedlength = 'Test'
set @variablelength = 'Test'
set @nvariablelength = 'Test'

select DATALENGTH(@fixedlength)
select DATALENGTH(@variablelength)		
select DATALENGTH(@nvariablelength)	

-- 결과
char = 10
varchar = 4
nvarchar = 8


set @fixedlength = '안녕'
set @variablelength = '안녕'
set @nvariablelength = '안녕'

select DATALENGTH(@fixedlength)
select DATALENGTH(@variablelength)		
select DATALENGTH(@nvariablelength)	

-- 결과
char = 10
varchar = 4
nvarchar = 4

'Database > MSSQL' 카테고리의 다른 글

char, varchar, nvarchar 의 차이  (0) 2015.01.08
Posted by 황군스

댓글을 달아 주세요