Hello I have a column in my table that is of type bit, and i will be running a script for many many databases that checks if it exists if it does i need to alter is and add a column and default its bit value to 1 as a default
I tried the following but when it created the column it still shows NULL what am i missing?
ALTER TABLE [myTable] ADD [ShippingOption] [bit] NULL DEFAULT 1
Thank you
Just use
WITH VALUESto have the new column take thedefaultvalue rather thanNULLThis is not required if your newly added column is marked as
NOT NULL. In that case the default will be applied automatically.