Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collation To Code Page (SQL Server)

How can I determine which code page a particular collation on SQL Server uses?

like image 307
Dan Avatar asked Mar 07 '12 18:03

Dan


People also ask

What is code page in collation?

Single-byte code pages are definitions of the characters mapped to each of the 256 bit patterns possible in a byte. Code pages define bit patterns for uppercase and lowercase characters, digits, symbols, and special characters such as !, @, #, or % .

What is code page 1252 SQL Server?

Code page 1252 (ISO character set) is the default character set. It is also known as the ISO 8859-1, Latin 1, or ANSI character set. It is compatible with the ANSI characters used by the Microsoft® Windows NT® and Microsoft Windows® operating systems.

Is SQL_Latin1_General_CP1_CI_AS the same as Latin1_General_CI_AS?

The SQL_Latin1_General_CP1_CI_AS collation is a SQL collation and the rules around sorting data for unicode and non-unicode data are different. The Latin1_General_CI_AS collation is a Windows collation and the rules around sorting unicode and non-unicode data are the same.

What is code page in SQL Server?

Database character set for Microsoft SQL Server is referred to as code page or collation. When creating a database, the collation type for the database can be specified.


1 Answers

The COLLATIONPROPERTY function can be used to get the code page. Here is the code page for every possible collation:

SELECT [Name], [Description], [CodePage] = COLLATIONPROPERTY([Name], 'CodePage')
FROM ::fn_helpcollations()
like image 184
Anthony Faull Avatar answered Sep 22 '22 06:09

Anthony Faull