Check Sql Server database is Case Sensitive or Insensitive (Collation)

If the collation property of a data base is

1.Latin1_General_BIN its case-sensitive
2.SQL_Latin1_General_CP1_CI_AS or Latin1_General_CI_AI its case-insensitive

There are two ways to find out the SQL Server Database Collation

1. Using DATABASEPROPERTYEX

DATABASEPROPERTYEX gets the current setting of the specified database option or property for the specified database.

Syntax :-
DATABASEPROPERTYEX ( database , property )

SELECT DATABASEPROPERTYEX(‘testdb’, ‘Collation’)

This returns the testdb Database Collation property value say if this testdb is a case-sensitive database then it returns

Latin1_General_BIN

2.Using Sql Server Management Studio

Step 1 : Open Sql Server Management Studio.

Step 2 : Right Click on database and click its properties


After clicking the properties you get a database properties modal box such as

The red box shows the collation property value of that database.

Popularity: 3% [?]

You can leave a response, or trackback from your own site.

Leave a Reply

Designed by: Business Web Hosting | Thanks to Buy Icons, travel tips and Used Cars