I have table with 100 rows and I am adding new column with default value as show below.
ALTER TABLE AccountDetails
ADD
UpdatedOn DATETIME DEFAULT GETDATE(),
UpdatedBy VARCHAR(50) DEFAULT 'System'
After execution of this alter statement new columns will be added to table ... which is perfect! however values for the existing rows for these columns will NULL.
Is there anyways where it will have default value by default instead of the executing separate update statement for those column to update default value explicitly?