Unicode character issue

  • Hi,

    I have a NVARCHAR(2) column which holds the 'Potential' for users. I am facing an issue related to this particular column. Inside the database for Russia [collation = Cyrillic_General_CI_AI] this column contains following records:

    a) A : This is English capital letter A

    b) А : This is Cyrillic capital letter A.

    Ideally it should not have both characters because both indicate same potential, but somehow it got inserted. By looking at the characters you can't find any difference. But a SELECT DISTINCT on this column will list both the records.

    Should I stop user from entering it in different encoding or is there a way to fetch it as single record?

    Thanks

    Anima NK

  • You can use the collate keyword along with Cast to collate all the data in the column to a single collation. If you take a distinct after collating the data you will get only a single record.

    Best method of course would be to make sure that such data does not get inserted .

    "Keep Trying"

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply