What is the Query used to Add Columns to Existing Table in SQL Server?
SQL (Structured Query Language) is a programming language for managing and handling data held in relational database management system (RDBMS). The SQL ALTER TABLE command is used to add, delete or modify columns in an existing table.
Use this simple tutorial and learn how to add column in SQL Server and the different SQL queries to add single or multiple columns to a table.
The SQL syntax for ALTER TABLE Add Column is
ALTER TABLE "table_name" ADD "column_name" "Data Type";
ALTER TABLE Customer ADD Sex char(1);
Note that the new column Gender becomes the last column in the Customer table.
Adding Multiple Columns:
It is also possible to add multiple columns. To add a column called "Address" and another column called "Telephone", use the following code.
ALTER TABLE Customer ADD (Address char(100), Telephone char(20) );