User Id :    Password :      New Member   Forgot Password  
Topic: What is Collate in SQL SERVER2000
Sachin Jain
30 Oct 2010 at 02:11 AM
What is Collate in SQL SERVER2000.

Re: What is Collate in SQL SERVER2000
Gaurav
31 Oct 2010 at 11:02 PM

Collation refers to a set of rules that determine how data is sorted and compared or
A collation specifies the bit patterns to represent each character and the rules by which characters are sorted and compared with another character.
If Column1 of Table1 has following values ‘
CaseSearch, casesearch, CASESEARCH, CaSeSeArCh’, following statement will return you all the four records.

SELECT Column1
FROM Table1
WHERE Column1 = 'casesearch'

To make the query case sensitive and retrieve only one record (“casesearch”) from above query, the collation of the query needs to be changed as follows.

SELECT
Column1
FROM Table1
WHERE Column1 COLLATE Latin1_General_CS_AS = 'casesearch'

Adding COLLATE Latin1_General_CS_AS makes the search case sensitive.
Default Collation of the SQL Server installation
SQL_Latin1_General_CP1_CI_AS is not case sensitive.
To change the collation of the any column for any table permanently run following query
.

Total Replies: 1
 
Featured Text Ad

Featured Ad