---
title: "SQL Server Collation"
canonical: "https://servicedesk.maxgeo.com/space/MAXGEO/1393623049/SQL%20Server%20Collation"
format: markdown
---
|  |  |  |  |
| --- | --- | --- | --- |
| Application: | SQL Server | Related Build Number: | ALL |
|  |  | Resolved Build Number | ALL |

---

Collations in SQL Server provide sorting rules, case, and accent sensitivity properties for your data. Collations that are used with character data types, such as **char** and **varchar**, dictate the code page and corresponding characters that can be represented for that data type.

maxgeo database, Maxwell Data Schema(MDS), requires that the SQL Server collation and Database Collation match. If they do not match then process like Assay import will not function as design and will produce errors when being used.

DataShed4 error example

![image](media://cf7493df-5d03-49ec-be15-a9c034be8964)

DataShed5 error example

![image-20240903-032124.png](media://fa547d74-ceb5-4306-91de-8e8751f74b15)

# How To Check the Collation 

### Using SQL Server Management Studio

**To view a collation setting for a server (instance of SQL Server) in Object Explorer**

1. In Object Explorer, connect to an instance of Database Engine.
2. Right-click the instance and select **Properties**.

![image-20240903-033546.png](media://66f6d9ee-4998-4453-9f9d-197cc1330bbf)

**To view a collation setting for a database in Object Explorer**

1. In Object Explorer, connect to an instance of Database Engine and then expand that instance.
2. Expand **Databases**, right-click the database and select **Properties**.

![image-20240903-033810.png](media://63338558-1940-449c-9fbf-834cae3b74d2)

### Using Transact-SQL

**To view the collation setting of a server**

1. In Object Explorer, connect to an instance of the Database Engine and on the toolbar, click **New Query**.
2. In the query window, enter the following statement that uses the SERVERPROPERTY system function.

```sql
SELECT CONVERT (varchar(256), SERVERPROPERTY('collation'));
```

![image-20240903-034019.png](media://21402412-9dcb-4d7d-83c6-f568a2872f0e)

**To view the collation setting of a database**

1. In Object Explorer, connect to an instance of the Database Engine and on the toolbar, click **New Query**.
2. In the query window, enter the following statement that uses the sys.databases system catalog view.

```
SELECT name, collation_name FROM sys.databases;
```

![image-20240903-034404.png](media://d9f4bcc2-b6ff-4356-ae16-9a49e2790ac3)



> ⚠️ DB Modification
> ⚠️ 
> ⚠️ Before any change is made to a user database (or system), maxgeo recommends competent staff should follow all standard database change management practices and never make untested changes to a production database.  
> ⚠️ Change, test and document all modifications on a test copy of your database to ensure results are as expected before implementing them on your live database. Always ensure a full backup is available in case rollback is required and follow all company change management procedures and practices.