SQL Standard Edition ALTER TABLE ADD column NOT NULL CONSTRAINT DEFAULT 0 (Blocking and taking a long time)
The application is down! Blocking alerts are flooding your email inbox! SQL Server is working as fast as it can but it's still your problem. Kill SPID, kill kill kill kill waiting for Roll Back. We need to find a new way to do the same thing.... Now what just happened? The creation of a new NOT NULL column with a default value to an existing table operation occurred on a large table: where every row in the table is trying to updated to add the default value of the new column. Now why did this happen? You are running SQL Standard 2016 or an Enterprise version prior to SQL 2012. Small tables this is fairly insignificant as it will be a fast operation, but for large tables this will be problematic as to completely prohibit the operation as it will be a long operation causing blocking which will lead to application and job timeouts. How can we reduce this and can we? Starting with SQL Server 2012 and if you are on ENTERPRISE Edition the operation in mos...