Tuesday, April 10, 2012

What is Collation fn_helpcollations()



The physical storage of information in SQL Server is handled or controlled by Collations. A collation is a set of rules that manage bit representation of characters in the computer.

If we want to store multilingual data in the SQL Server we may need to change the collation settings of the table.

To view the current collation setting

SELECT SERVERPROPERTY('Collation') – Returns SQL_Latin1_General_CP1_CI_AS

SELECT * FROM fn_helpcollations() – List all the collations that current version supports

How to find the Database Collation?

SELECT DATABASEPROPERTYEX('Database_Name', 'Collation')

To view the collation of all the databases

SELECT name, collation_name FROM sys.databases

No comments: