Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Why SQL_Hungarian_CP1250_CI_AS is case sensitive ?

$
0
0

Hi,

I have the following databaase :

CREATE DATABASE Hungarian COLLATE SQL_Hungarian_CP1250_CI_AS 

USE Hungarian
CREATE TABLE [dbo].[tbl](
[id] [int] IDENTITY(1,1) NOT NULL,
[my_nvarchar] [nvarchar](50),
[my_varchar] [varchar](50)
)
GO
INSERT INTO tbl ([my_nvarchar],[my_varchar]) VALUES('C','C')
INSERT INTO tbl ([my_nvarchar],[my_varchar]) VALUES('c','c')
INSERT INTO tbl ([my_nvarchar],[my_varchar]) VALUES('S','S')
INSERT INTO tbl ([my_nvarchar],[my_varchar]) VALUES('s','s')
INSERT INTO tbl ([my_nvarchar],[my_varchar]) VALUES('cs','cs')
INSERT INTO tbl ([my_nvarchar],[my_varchar]) VALUES('CS','CS')
INSERT INTO tbl ([my_nvarchar],[my_varchar]) VALUES('Cs','Cs')
INSERT INTO tbl ([my_nvarchar],[my_varchar]) VALUES('cS','cS')

why do I get different results for the following SQLs  if I'm Case Insensitive ?

SELECT * FROM dbo.tbl WHERE my_nvarchar='cS'
/* cS*/
SELECT * FROM dbo.tbl WHERE my_nvarchar='CS'
/*cs CS Cs*/

BTW, If I select Hungarian_Technical_CI_AS  I do not have the problem.


Regards, Asi Pesa


Viewing all articles
Browse latest Browse all 23857

Trending Articles