Does Alter Table Add Column with Default Value work the same on Standard and on Enterprise

Miles P 20 Reputation points
2025-07-23T15:21:32.1533333+00:00

SQL Server 2019 Standard Edition

ALTER TABLE CommunicationsRecipient ADD CausedUnsubscribe Bit NOT NULL DEFAULT 0;

I had a 3rd party software upgrade that failed on an Alter Table Add column statement on a 45 million row table. The Upgrade has a built-in 6 minute timeout so any tSQL that runs for 6 minutes will be aborted. My workaround was to rename the table and Alter it(25 minutes), create a new replacement table, rerun the upgrade against this new empty table, Delete the new empty table, and then change the name of the renamed-Altered table back to the original name.

I think that the reason that the Alter Table Add Column with Default Value takes 25 minutes is because we use Standard Edition and that it would be almost instantaneous on Enterprise Edition. But I need to be sure before presenting the option of going from the Standard Edition to Enterprise which costs quite a bit more. Does the above tsql statement operate differently on 2019 Standard and 2019 Enterprise? Does any of the newer Standard Editions run this tSQL statement the same way as on the Enterprise Edition? .... Using sys.system_internals_partition_columns.is_nullable/default_value?

SQL Server Database Engine
0 comments No comments
{count} votes

Accepted answer
  1. Erland Sommarskog 124.2K Reputation points MVP Volunteer Moderator
    2025-07-23T16:38:41.27+00:00

    Your observation is correct. Adding a non-nullable column with a default value is a size-of-data of operation in Standard Edition, because every row needs to be updated.

    In Enterprise Edition there is an optimisation that makes this operation a metadata- only operation. The default value is not written until the row is touched. (Which could be an index rebuild.)

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 79,101 Reputation points Volunteer Moderator
    2025-07-23T15:34:22.56+00:00

    While sql enterprise has scaling features not in standard, it is unlikely the alter table would be that much faster. As the alter may require altering every row, the performance is mostly based on the table size and disk performance.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.