SQL Interview: 39 Char data types and row compression

This is a post in the SQL Interview series. These aren’t trick or gotcha questions, they’re just questions designed to scope out a candidate’s knowledge around SQL Server and Azure SQL Database.
Section: Development Level: Medium
Question:
You have a column in your database that is defined as char(20). Whenever you query it, 20 characters are returned, with space padding any unused characters.
An administrator has suggested applying ROW compression to the table, to save space and improve performance.
After ROW compression is applied, when you query this column, will you still always see 20 characters returned?
Answer:
ROW compression does not change anything about the data that is returned for any data type. You will still see 20 characters returned, even though that’s not how the data will be stored internally.
2025-04-23