Set the Character Set and Collation of a Table in MariaDB

You can specify the character set and collation at various levels in MariaDB. You can specify them at the connection level, the server level, the database level, the table level, and even the column level.

You can also specify a collation in your queries so that it overrides any collation that has been previously specified at the aforementioned levels.

To set the character set and collation at the table level, use the CREATE TABLE statement or ALTER TABLE statement (depending on whether you’re creating the table or modifying it).

Continue reading

Show the Collation in MariaDB

In MariaDB, collation can be applied at many levels. Collation can be applied at the server level, the connection level, the database level, the table level, and even at the column level.

It’s also possible to specify a collation at the query level, so that it will override any collation that has been applied at the database, table, or column levels.

MariaDB provides a number of options for returning the collation at the various levels.

Continue reading

How to Set the Character Set and Collation of a Database in MySQL

In MySQL, you can specify the character set and collation at various levels. You can specify them at the connection level, the server level, the database level, the table level, and the column level. You can also specify a collation in your queries so that it overrides any collation that has been previously specified at the aforementioned levels.

To set the character set and collation at the database level, you can use the CREATE DATABASE statement or ALTER DATABASE statement (depending on whether you’re creating the database or modifying it).
Continue reading

How to Set the Character Set and Collation of a Table in MySQL

In MySQL, you can specify the character set and collation at various levels. You can specify them at the connection level, the server level, the database level, the table level, and the column level. You can also specify a collation in your queries so that it overrides any collation that has been previously specified at the aforementioned levels.

To set the character set and collation at the table level, you can use the CREATE TABLE statement or ALTER TABLE statement (depending on whether you’re creating the table or modifying it).
Continue reading

How to Set the Character Set and Collation of a Column in MySQL

In MySQL, you can specify the character set and collation at various levels. You can specify them at the connection level, the server level, the database level, the table level, and the column level. You can also specify a collation in your queries so that it overrides any collation that has been previously specified at the aforementioned levels.

To set the character set and collation at the column level, you can use the CREATE TABLE statement or ALTER TABLE statement (depending on whether you’re creating the table or modifying it), and specify the character set and collation within the column’s definition (the column that you want to set the character set/collation on).
Continue reading

How to Set the Collation of a Database in SQL Server (T-SQL)

When using SQL Server, you can use T-SQL to specify the default collation of a database. Specifically, you can use the COLLATE clause of either the CREATE DATABASE or ALTER DATABASE  statements.

The COLLATE clause is optional – if you don’t use it when creating the database, the database will use the default collation of the server (which was specified at the time SQL Server was installed). And if you don’t specify the clause when altering the database, its default collation won’t change.
Continue reading

How to Set the Collation of a Column in SQL Server (T-SQL)

By default, each column in a SQL Server database uses the collation that’s been specified at the database level. And by default, the database collation is taken from the server collation. However, these collation settings can be overridden, both at the database level and the column level by explicitly setting the collation at that level.

This page demonstrates how to specify the collation of a column. You can set the collation by adding the T-SQL COLLATE clause to the CREATE TABLE and ALTER TABLE statements. When you use those statements, you define the column and its properties, including any collation settings. The COLLATE clause is optional so if you don’t include it, the column will simply use the default collation of the database.
Continue reading