public knowledge blog_load(sender Virendra)

                                                                                                                          Nothing shocks me, I am a Software Engineer.

Case Sensitive Comparison in SQL Server

Posted by Virendra Dugar on July 24, 2009

SQL Server performs the string comparison irrespective of the case. For eg. “VIRENDRA” and ‘virendra’ are equal when we do comparison in SQL Server.

I found an article which gives complete detail about case sensitive string comparison.

Below are the techniques to do case sensitive comparison

  • Converting data to binary type before comparison.
  • Using the COLLATE clause to dictate the case sensitiveness of the query.
  • Using BINARY_CHECKSUM function.
  • Changing the collation of the column permanently, so that all comparisons are case sensitive by default.
  • Using computed columns.

Check the original article for more details.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: