Skip to content
Loading
how to add multiple columns in alter statement
  • Alter statement can be used to add, modify, drop, rename a column and to rename table.
     
    Add Multiple column,
     
    Syntax:
     
    ALTER TABLE tableName
    ADD columnName1 columnDefinition,
             columnName2 columnDefinition; 
    +1
  • In the SQL, the ALTER command is used to ADD, DROP, MODIFY the existing table with the newly updated fields.
    Here ADD command is used to adding new columns to an existing table.
    For Example, if the table consists of four columns and I want to add more columns, then ADD command can be used and the position of inserting new column can also be chosed.
     
    For Adding new column in specific positions,
    ALTER TABLE[sample].[dbo].[USER]
    ADD COLUMN DOB Date NULL,
    ADD COLUMN Phone nvarchar(10) NULL
    AFTER LASTNAME;
     
    +1
  • Abhishek Chadha
    I don't know for which DB type you want to alter multiple Columns, but you can refer to below article and alter any DB Type - 

    https://www.techonthenet.com/sql/tables/alter_table.php
    +1
  • Varun Setia

    Here is one example,

     

    ALTER TABLE employees

    ADD last_name VARCHAR(50),

    first_name VARCHAR(40);

    +1
  • Ganesan C
    Please refer below link. https://www.sqltutorial.org/sql-add-column/
    +1