SQL Interview: 79 Extensive use of varchar(max)

SQL Interview: 79 Extensive use of varchar(max)

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: Administration Level: Advanced

Question:

You are reviewing a database design from one of your developers.

He normally works with PostgreSQL and in that language, he uses the text data type for all strings.

When creating the database in SQL Server, he has used the varchar(max) data type for all strings.

Is this an issue? And if so, why?

Answer:

The problem with using varchar(max) for all strings in SQL Server is that it can cause excessive memory grant requests in query plans involving the table.

This can slow the start of queries or even cause them to fail.

2025-09-17