When Your SQL Data File Stops Growing at 16TB — Here’s Why

To be honest, this isn’t something I ever thought I needed to know, until one day, I found a database where transactions were failing with the error:

“PRIMARY filegroup is full.”

Naturally, I did what any DBA would do and checked whether auto-growth was enabled. It was.

So why wasn’t the file growing?

The answer wasn’t immediately clear, but I had a suspicion.

Understanding the Limit

Let’s do the math: 2,147,483,647 pages × 8 KB = 17,179,869,176 KB ≈ 16 TB

To be precise, it’s 16 TB minus 128 KB, but practically speaking, that’s your ceiling. Once a data file reaches that size, it cannot grow further, even if auto-growth is enabled.


What Happens at the Limit

When a file hits the 16TB boundary, SQL Server stops allocating new space and you’ll start seeing errors like:

Msg 1101, Level 17, State 12, Line 1

Could not allocate a new page for database ‘YourDB’ because of insufficient disk space in filegroup ‘PRIMARY’.

Auto-growth won’t help you here, it simply fails silently because the file can’t grow beyond the INT limit.

This issue applies per data file, not per database. That means your database can grow beyond 16TB overall, but only if you add additional data files to the same filegroup.

The Real-World Example

Any guesses how big my data file was?

You got it — 16TB.

That’s a lot of space, and hopefully you never have to manage a single file that large. But if you do, be aware that once it hits this limit, new writes will fail, even if auto-growth is configured properly.

The fix is simple: Add another data file before you reach the limit.

2 Comments

  1. Dave Mason's avatar Dave Mason says:

    This scenario can be even more confusing if FILL FACTOR is < 100 across all (or most) tables and indexes. There's still some free space in the data file, but it can't grow any larger. Lot's of page splits ensue, and performance plummets.
    Great post. Thanks for sharing!

    Like

    1. Great point. I don’t think most people understand the impact of lowering fill factor. In this case, a fill factor of 80% would basically equator to 3.2 of was wasted file and disk space.

      Like

Leave a reply to Dave Mason Cancel reply