sexta-feira, 5 de fevereiro de 2021

[SQL] COLLATE

create table #aaa
(
       PALAVRA1  varchar(max),
       PALAVRA2  varchar(max)
)

insert into #aaa(PALAVRA1, PALAVRA2) values ('A','A')
insert into #aaa(PALAVRA1, PALAVRA2) values ('ã','A')
insert into #aaa(PALAVRA1, PALAVRA2) values ('A','a')
insert into #aaa(PALAVRA1, PALAVRA2) values ('Aa','aa')


select *, case when  PALAVRA1 collate Latin1_General_CI_AI = PALAVRA2 then 'igual' else 'diferente' end as c from #aaa

select *, case when  PALAVRA1 collate Latin1_General_CS_AS = PALAVRA2 then 'igual' else 'diferente' end as c from #aaa

drop table #aaa

Nenhum comentário:

Postar um comentário

[ASP 2.0] Crie sua função FileCopy

  <% Function FileCopy(byVal source, byVal destination)                 Dim objFSO, objToCopy, boolErr, strErrDesc                 On Err...