Skip to content

CATALOG_COLLATION on SQL Server.md #10032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: live
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/t-sql/statements/create-database-transact-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ CREATE DATABASE database_name
| TRUSTWORTHY { OFF | ON }
| PERSISTENT_LOG_BUFFER=ON ( DIRECTORY_NAME='path-to-directory-on-a-DAX-volume' )
| LEDGER = {ON | OFF }
| CATALOG_COLLATION = { DATABASE_DEFAULT | SQL_Latin1_General_CP1_CI_AS }
}

<filestream_option> ::=
Expand Down Expand Up @@ -210,6 +211,26 @@ For more information about the Windows and SQL collation names, see [COLLATE](~/
> [!NOTE]
> Contained databases are collated differently than non-contained databases. For more information, see [Contained Database Collations](../../relational-databases/databases/contained-database-collations.md).

#### CATALOG_COLLATION

Specifies the default collation for the metadata catalog. The `CATALOG_COLLATION` argument is only available during database creation and cannot be changed after creation.

By default, the metadata catalog for system object names is collated to *SQL_Latin1_General_CP1_CI_AS* collation. This is the default setting on Azure SQL Database if CATALOG_COLLATION is unspecified.

*DATABASE_DEFAULT* specifies that the metadata catalog used for system views and system tables be collated to match the collation for the database. If you desire that object identifiers in system metadata follow the same collation as data, you should create the database `WITH CATALOG_COLLATION = DATABASE_DEFAULT`.

- You might desire different collations for data and object identifiers. The following example creates the database with a case-sensitive collation for row data, but will use the default SQL_Latin1_General_CP1_CI_AS case-insensitive collation for object identifiers.

```sql
CREATE DATABASE [different-collations] COLLATE SQL_Latin1_General_CP1_CS_AS
```

- If you desire that both data and system metadata use the same collation, specify `WITH CATALOG_COLLATION = DATABASE_DEFAULT`. The following example creates the database with a case-sensitive collation, which will be used for object identifiers.

```sql
CREATE DATABASE [same-collations] COLLATE SQL_Latin1_General_CP1_CS_AS
WITH CATALOG_COLLATION = DATABASE_DEFAULT

#### WITH \<option>

#### <filestream_option>
Expand Down