Add new column to a table
ALTER TABLE (Transact-SQL)
Last updated
Was this helpful?
ALTER TABLE (Transact-SQL)
Last updated
Was this helpful?
Modifies a table definition by altering, adding, or dropping columns and constraints. ALTER TABLE also reassigns and rebuilds partitions, or disables and enables constraints and triggers.
For more information about the syntax conventions, see .
Take a look at this if you want to know more about altering statements in SQL.
If we need to add a new column to our table however such a new table needs to calculate something, we can ask SQL to do it for us. Just like the following example:
So we can now calculate the value thanks to SQL.