Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
SQL Server uses an implementation of the Standard Compression Scheme for Unicode (SCSU) algorithm to compress Unicode values that are stored in row or page compressed objects. For these compressed objects, Unicode compression is automatic for nchar(n) and nvarchar(n) columns. The Database Engine stores Unicode data as 2 bytes, regardless of locale. This is known as UCS-2 encoding. For some locales, the implementation of SCSU compression in SQL Server can save up to 50 percent in storage space.
Unicode compression supports the fixed-length nchar(n) and nvarchar(n) data types. Data values that are stored off row or in nvarchar(max) columns aren't compressed.
Note
Unicode compression is not supported for nvarchar(max) data even if it is stored in row. However, this data type can still benefit from page compression.
When a SQL Server database is upgraded to SQL Server, Unicode compression-related changes aren't made to any database object, compressed or uncompressed. After the database is upgraded, objects are affected as follows:
If the object isn't compressed, no changes are made and the object continues to function as it did previously.
Row- or page-compressed objects continue to function as they did previously. Uncompressed data remains in uncompressed form until its value is updated.
New rows that are inserted into a row- or page-compressed table are compressed using Unicode compression.
Note
To take full advantage of the benefits of Unicode compression, rebuild the object with page or row compression.
When an index is created or rebuilt or when a value is changed in a table that was compressed with row or page compression, the affected index or value is stored compressed only if its compressed size is less than its current size. This prevents rows in a table or index from increasing in size because of Unicode compression.
The storage space that compression saves depends on the characteristics of the data that is being compressed and the locale of the data. The following table lists the space savings that can be achieved for several locales.
Locale | Compression percent |
---|---|
English | 50% |
German | 50% |
Hindi | 50% |
Turkish | 48% |
Vietnamese | 39% |
Japanese | 15% |
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Implement compliance controls for sensitive data - Training
Implement compliance controls for sensitive data