I have a table UserType:
id (int),
type nvarchar(50)
I have inserted some rows into that table
INSERT INTO [UserType] VALUES (N'កក្កដា');
INSERT INTO [UserType] VALUES (N'វិច្ឆិកា');
And it's successfully inserted.
Then when I tried to query it back
select *
from [UserType]
where type=N'កក្កដា';
It returns all rows.
What's wrong? Please help!
Looks like you database is Accent Insensitive.
You need to explicitly mention the proper collation name in where clause to filter the proper data.
Use Latin1_General_100_CI_AS collation which is accent sensitive. Try this.
SELECT *
FROM [UserType]
WHERE type = CONVERT(NVARCHAR(50), N'វិច្ឆិកា') COLLATE Latin1_General_100_CI_AS;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With