QuestionQ28

Monitor, configure, and optimize database resources

You have an Azure SQL database named DB1.

You have a table named Table1 that contains 20 columns of type CHAR(400). Row compression is enabled for Table1.

During a database audit, you find that none of the fields contains more than 150 characters.

You need to ensure that page compression can be applied to Table1.

What should you do?

Explanation

A table cannot be enabled for row or page compression when its maximum row size plus compression overhead exceeds 8,060 bytes. Changing the 20 fixed-length CHAR(400) columns to VARCHAR(200) lowers the maximum declared row width sufficiently while still accommodating values of up to 150 characters. Sparse columns cannot be used with data compression, and off-row data is not compressed.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!