I need to add a column to an existing table in my live sql database.
I know how to use the ALTER command, but what I want to know is the effect this has on the table.
For example,, if using SQL Management Studio, it claims that adding a column will “drop and recreate” the table.
Will the ALTER table command do that as well?
This table is CONSTANTLY accessed and VERY important so I want to make VERY sure of this before going forward.
No,
ALTER TABLE x ADD ywill not recreate the table, it will just add the column. The only problem you can have is if the column should beNOT NULL. In that case, the command will end with error unless you specify a default value (if there are already rows in that table). It’s because it needs to know what to fill to the existing rows.