Data World

SQL Server – Check whether the SQL server is configured for case sensitivity or not

Posted by Pramod Singla on June 10, 2015


Problem: How to check whether the SQL server is configured for case sensitivity or not?

Solution:

  • Case sensitivity: By Case Sensitive, we mean case sensitivity of the objects in the database, i.e. the following two statements are not equal:-

SELECT * FROM TABLE

SELECT * FROM table 

  • SQL server determines case sensitivity by COLLATION.
  • CollationCollation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width.
  • COLLATION can be set at various levels:-

1. Server-level
2. Database-level
3. Column-level
4. Expression-level

  • Check Database Collation:-

          SELECT DATABASEPROPERTYEX (”, ‘Collation’)

          Result: SQL_Latin1_General_CP1_CI_AS (means Case Insensitive)

          Result: SQL_Latin1_General_CP1_CS_AS (means Case Sensitive)

Advertisements

One Response to “SQL Server – Check whether the SQL server is configured for case sensitivity or not”

  1. […]          Both the queries will fetch same result unless SQL Server database is not configured to be case sensitive. To check case sensitivity see here. […]

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

 
%d bloggers like this: