You can specify the collation for each database when you create the database. The default collation is inferred from the code page and language of the database server's computer's operating system.
For information about using the NCHAR collation, see NCHAR collation.
To specify a database collation when creating a database (command prompt)
Run the following command to list the recommended collation sequences:
dbinit -l |
The first column of the list is the collation label, which you supply when creating the database.
Create a database using the dbinit utility, specifying a collation sequence using the -z option. The following command creates a database with a Greek collation.
dbinit -z 1253ELL mydb.db |
The following command creates a case sensitive database, spanish.db, which uses the 1262spa collation for non-NCHAR data. For NCHAR data, the UCA collation is specified, with locale es, and sorting by lowercase first.
dbinit -c -z 1252spa -zn uca(locale=es;case=LowerFirst) spanish.db |
To specify a database collation when creating a database (SQL)
You can use the CREATE DATABASE statement to create a database. The following statement creates a database with a Greek collation:
CREATE DATABASE 'mydb.db' COLLATION '1253ELL'; |
The following statement creates a database using code page 1252 and uses the UCA for both CHAR and NCHAR data types. Accents and case are respected during comparison and sorting.
CREATE DATABASE 'c:\\uca.db' COLLATION 'UCA' ENCODING 'CP1252' NCHAR COLLATION 'UCA' ACCENT RESPECT CASE RESPECT; |
To specify a database collation when creating a database (Sybase Central)
You can use the Create Database Wizard in Sybase Central to create a database. The wizard has a page where you choose a collation from a list.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |