How to make Like Case Sensitive?

Today, I got a question from customer: I have one column (Type: nVarchar) in a table which has data something like this: a1 aa aa2 AB I want to show all the rows which have all the lower case letters in the above mentioned column. The following query works: select * from test WHERE LTRIM(RTRIM(a))…

0

Unicode References

In this article, I recommend several Unicode articles/websites for reference. Note, the list is not yet completed,  I will add more entries and make better categorization My blog is a good site for collation issues in SQL Server. Sort it all out. Michael Kaplan’s random stuff of dubious value is a great source for learning…

1

SQL Server and UTF-8 Encoding (1) -True or False

Today, I will start my series of articles about SQL Server and Unicode UTF-8 Encoding. In many times, I found when people ask me about UTF-8, they actually don’t understand UTF-8.  So today’s talk will be quite short. I just clarify some misunderstand.1.    SQL Server doesn’t support Unicode, do you mean UTF-8?     Sometime, people…

74

Be aware of comparing unicode constant with varchar column (updated)

    Today,  I looked for SQL Server JDBC Driver’s  sendStringParametersAsUnicode, this parameter controls how Unicode String (Java only have Unicode string which is UTF-16 encoding) will be sending to SQL Server.   As the name of this parameter indicate,  when the parameter equals to true, which is the default setting,  we always send unicode data, i.e.,…

0

Introduce the Turkish I issue

Today, I will discuss the famous Turkish I issue.  Below is one customer’s problem related to Turkish collation? When I use TURKISH_CI_AS collation, some of the field names in the database becomes case-sensitive, as a result queries are returning Invalid Column Name exception if there is a difference between the case of queries and case…

1

UTF-16 Encoding and SQL Server (1)

I will start several articles describe my thought on UTF-16 support in SQL Server.  Before I start to discuss this topic, I use the content “Supplementary Characters, Surrogate Pairs and SQL”   to describe the difference between UTF-16 and UCS-2: UTF-16: This encoding stores the basic Unicode characters using single 16 bit units and others characters…

6

Do we need a case insensitive binary collaton?

In SQL Server, the binary collation (collation name ending with BIN2) use an algorithm which directly compare the code page of the characters. In other word, it is not linguistic sorting.  However, it happens that it can sort alphabet and numbers  correctly since we assign the code points of these characters in order. However, due…

1

Changing collation of a column is not so trival

Several days ago, one customer asked me a question about collation. Here is the question:      My applications requirement to search English characters along with accent characters like (å, Å),  If we search Name “James “ by my application it should return both names “James” and “Jåmes”.       We are using SQL_Latin1_General_CP1_CI_AS Collation after doing…

1

Why should we bother about Surrogate characer?

Today, someone ask following questions:  1. We know that the Surrogate Characters have two bytes when counting, so when we design this character in DB table, we should set double size of your original type, shouldn’t we? 2. When comparing string, if we can’t use Binary collating sequence, then we will got different result from…

1