Checking The String With Case Sensitivity – SQL

The Following Phrase Is Used For Checking The String With Case Sensitivity:

COLLATE sql_latin1_general_cp1_cs_as

and is used like the following:

Lets Take simple example to understand how it work: CASE SENSITIVE

UserName = admin Password = Admin

  • SELECT * FROM tbUsers WHERE UserName=’Admin’ and Password=’Admin’ COLLATE sql_latin1_general_cp1_cs_as
It should not match and return 0 records.
  • SELECT * FROM tbUsers WHERE UserName=’admin’ and Password=’Admin’ COLLATE sql_latin1_general_cp1_cs_as

It check the string and return you precise result.

The inverse of the above phrase is default and the following which is used the same way: CASE INSENSITIVE

  • SELECT * FROM tbUsers WHERE UserName=’Admin’ and Password=’Admin’  COLLATE sql_latin1_general_cp1_ci_as

 

“Sometimes You Need To Be Faster In Taking Action Than The Decision Is Made.

Because If You Don’t Make A Choice, The Choice Will Make You.”

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s